Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Updates website structured data #2662

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/core/cms/faststore/content-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@
"canonical": {
"title": "Canonical url for the page",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"publisherId": {
"title": "Publisher ID",
"description": "Uses to identifier to reference the publisher. E.g.: #website",
"type": "string"
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/discovery.config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module.exports = {
description: 'Fast Demo Store',
titleTemplate: '%s | FastStore',
author: 'Store Framework',
name: 'FastStore',
publisherId: '',
plp: {
titleTemplate: '%s | FastStore PLP',
descriptionTemplate: '%s products on FastStore Product Listing Page',
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function Page({
data: serverData,
}

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

return (
<>
{/* SEO */}
Expand All @@ -47,13 +49,16 @@ function Page({
}}
/>
<SiteLinksSearchBoxJsonLd
type="WebSite"
name={settings?.seo?.name ?? storeConfig.seo.name}
url={storeConfig.storeUrl}
potentialActions={[
{
target: `${storeConfig.storeUrl}/s/?q`,
queryInput: 'search_term_string',
},
]}
{...(publisherId && { publisher: { '@id': publisherId } })}
hellofanny marked this conversation as resolved.
Show resolved Hide resolved
/>

{/*
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/server/cms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export type PageContentType = ContentData & {
title: string
description: string
canonical?: string
name?: string
publisherId?: string
}
}
}
Expand Down
Loading