fix: apply seo agent improvements to src/components/seo/WebsiteJsonLd.tsx
This commit is contained in:
parent
491761a4b2
commit
3d474233d1
|
|
@ -0,0 +1,27 @@
|
|||
import JsonLd from './JsonLd'
|
||||
|
||||
const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL || 'https://example.com'
|
||||
const SITE_NAME = process.env.NEXT_PUBLIC_SITE_NAME || 'My Personal Site'
|
||||
|
||||
/**
|
||||
* Renders Schema.org WebSite + SearchAction structured data.
|
||||
* Place this in your root layout or homepage.
|
||||
*/
|
||||
export default function WebsiteJsonLd() {
|
||||
const data = {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'WebSite',
|
||||
name: SITE_NAME,
|
||||
url: SITE_URL,
|
||||
potentialAction: {
|
||||
'@type': 'SearchAction',
|
||||
target: {
|
||||
'@type': 'EntryPoint',
|
||||
urlTemplate: `${SITE_URL}/blog?q={search_term_string}`,
|
||||
},
|
||||
'query-input': 'required name=search_term_string',
|
||||
},
|
||||
}
|
||||
|
||||
return <JsonLd id="website-jsonld" data={data} />
|
||||
}
|
||||
Loading…
Reference in New Issue