Skip to content

Commit

Permalink
feat: Attempts to add the json-ld to the page
Browse files Browse the repository at this point in the history
  • Loading branch information
hellofanny committed Aug 23, 2024
1 parent 432c319 commit eb33ad8
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions packages/core/app/fs-next-update/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,30 @@ async function Page() {
data: serverData,
}

const jsonLd = {
'@context': 'https://schema.org',
'@type': 'WebSite',
url: storeConfig.storeUrl,
potentialAction: [
{
'@type': 'SearchAction',
target: `${storeConfig.storeUrl}/s/?q={search_term_string}`,
'query-input': 'required name=search_term_string',
},
],
}

return (
<PageProvider context={context}>
<RenderSections sections={sections} components={COMPONENTS} />
</PageProvider>
<>
{/* Adding JSON-LD schema to the page */}
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<PageProvider context={context}>
<RenderSections sections={sections} components={COMPONENTS} />
</PageProvider>
</>
)
}

Expand Down

0 comments on commit eb33ad8

Please sign in to comment.