Skip to content

Commit

Permalink
chore: Adds image and address country attr
Browse files Browse the repository at this point in the history
  • Loading branch information
hellofanny committed Feb 6, 2025
1 parent 7238bc3 commit 53e05f1
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 7 deletions.
28 changes: 28 additions & 0 deletions packages/core/cms/faststore/content-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,29 @@
"description": "A logo that is representative of your organization. Image guidelines: https://developers.google.com/search/docs/appearance/structured-data/organization",
"type": "string"
},
"image": {
"title": "Organization image/logo object",
"description": "An image that is representative of your organization. Image guidelines: https://developers.google.com/search/docs/appearance/structured-data/organization",
"required": ["url"],
"type": "object",
"properties": {
"url": {
"title": "Organization image URL",
"description": "The URL of the image. Make sure the url is crawlable and indexable.",
"type": "string"
},
"caption": {
"title": "Organization image caption",
"description": "A short description of the image.",
"type": "string"
},
"id": {
"title": "Organization image ID",
"description": "A unique identifier for the image. E.g.: #logo",
"type": "string"
}
}
},
"email": {
"title": "Organization email",
"description": "The email address to contact your business",
Expand All @@ -163,6 +186,11 @@
"description": "The city of your postal address.",
"type": "string"
},
"addressCountry": {
"title": "Country",
"description": "The country of your postal address. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example 'BR','US'.",
"type": "string"
},
"postalCode": {
"title": "Postal Code",
"type": "string"
Expand Down
7 changes: 6 additions & 1 deletion packages/core/discovery.config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ module.exports = {
'https://www.instagram.com/vtex',
],
logo: 'https://vtex.com/_next/static/media/vtex-logo.80485bcf.svg',
image: 'https://vtex.com/_next/static/media/vtex-logo.80485bcf.svg',
image: {
url: 'https://vtex.com/_next/static/media/vtex-logo.80485bcf.svg',
caption: 'FastStore',
id: '',
},
name: 'VTEX',
legalName: 'VTEX Commerce',
email: '[email protected]',
Expand All @@ -23,6 +27,7 @@ module.exports = {
streetAddress: 'Rue Improbable 99',
addressLocality: 'Rio de Janeiro',
postalCode: '06473-000',
addressCountry: 'BR',
},
},
plp: {
Expand Down
21 changes: 16 additions & 5 deletions packages/core/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,18 @@ function Page({
logo={
settings?.seo?.organization?.logo ?? storeConfig.seo.organization.logo
}
image={
settings?.seo?.organization?.image ??
storeConfig.seo.organization.image
}
image={{
type: 'ImageObject',
url:
settings?.seo?.organization?.image?.url ??
storeConfig.seo.organization.image.url,
caption:
settings?.seo?.organization?.image.caption ??
storeConfig.seo.organization.image.caption,
id:
settings?.seo?.organization?.image?.id ??
storeConfig.seo.organization.image.id,
}}
name={
settings?.seo?.organization?.name ?? storeConfig.seo.organization.name
}
Expand All @@ -92,7 +100,7 @@ function Page({
storeConfig.seo.organization.telephone
}
address={{
'@type': 'PostalAddress',
type: 'PostalAddress',
streetAddress:
settings?.seo?.organization?.address?.streetAddress ??
storeConfig.seo.organization.address.streetAddress,
Expand All @@ -102,6 +110,9 @@ function Page({
postalCode:
settings?.seo?.organization?.address?.postalCode ??
storeConfig.seo.organization.address.postalCode,
addressCountry:
settings?.seo?.organization?.address?.addressCountry ??
storeConfig.seo.organization.address.addressCountry,
}}
/>

Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/server/cms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ export type PageContentType = ContentData & {
url?: string
sameAs?: string[]
logo?: string
image?: string
image?: {
url: string
caption: string
id: string
}
name: string
legalName?: string
email?: string
Expand All @@ -46,6 +50,7 @@ export type PageContentType = ContentData & {
streetAddress?: string
addressLocality?: string
postalCode?: string
addressCountry?: string
}
}
}
Expand Down

0 comments on commit 53e05f1

Please sign in to comment.