Skip to content

Commit

Permalink
chore: Adds website id attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
hellofanny committed Feb 18, 2025
1 parent 1c0e35f commit 6d44df4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/cms/faststore/content-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@
},
"publisherId": {
"title": "Publisher ID",
"description": "A unique identifier used to reference the publisher. This can be a descriptive value (e.g., `#organization`) or a full URL (e.g., `https://example.com/publisher`).",
"description": "A unique identifier used to internal reference the publisher. This can be a descriptive value (e.g., `#organization`) or a full URL (e.g., `https://example.com/publisher`).",
"type": "string"
},
"websiteId": {
"title": "Website ID",
"description": "A unique identifier used to internal reference the website. This can be a descriptive value (e.g., `#website`) or a full URL (e.g., `https://example.com/website`).",
"type": "string"
},
"organization": {
Expand Down
1 change: 1 addition & 0 deletions packages/core/discovery.config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
author: 'Store Framework',
name: 'FastStore',
publisherId: '',
websiteId: '',
plp: {
titleTemplate: '%s | FastStore PLP',
descriptionTemplate: '%s products on FastStore Product Listing Page',
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function Page({
}

const publisherId = settings?.seo?.publisherId ?? storeConfig.seo.publisherId
const websiteId = settings?.seo?.websiteId ?? storeConfig.seo.websiteId

const organizationAddress = Object.entries(
settings?.seo?.organization?.address ?? {}
Expand Down Expand Up @@ -70,6 +71,7 @@ function Page({
queryInput: 'search_term_string',
},
]}
{...(websiteId && { id: websiteId })}
{...(publisherId && { publisher: { '@id': publisherId } })}
/>

Expand Down
1 change: 1 addition & 0 deletions packages/core/src/server/cms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type PageContentType = ContentData & {
canonical?: string
name?: string
publisherId?: string
websiteId?: string
organization: {
id?: string
url?: string
Expand Down

0 comments on commit 6d44df4

Please sign in to comment.