fix: apply seo agent improvements to src/app/blog/layout.tsx
This commit is contained in:
parent
6593c1caa0
commit
e2c0a41c43
|
|
@ -0,0 +1,41 @@
|
||||||
|
import type { Metadata } from 'next'
|
||||||
|
|
||||||
|
const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL || 'https://example.com'
|
||||||
|
const SITE_NAME = process.env.NEXT_PUBLIC_SITE_NAME || 'My Personal Site'
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
alternates: {
|
||||||
|
types: {
|
||||||
|
'application/rss+xml': `${SITE_URL}/feed.xml`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function BlogLayout({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode
|
||||||
|
}) {
|
||||||
|
const blogListingJsonLd = {
|
||||||
|
'@context': 'https://schema.org',
|
||||||
|
'@type': 'Blog',
|
||||||
|
name: `${SITE_NAME} — Blog`,
|
||||||
|
url: `${SITE_URL}/blog`,
|
||||||
|
description: 'Articles, thoughts, and tutorials.',
|
||||||
|
publisher: {
|
||||||
|
'@type': 'Person',
|
||||||
|
name: SITE_NAME,
|
||||||
|
url: SITE_URL,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<script
|
||||||
|
type="application/ld+json"
|
||||||
|
dangerouslySetInnerHTML={{ __html: JSON.stringify(blogListingJsonLd) }}
|
||||||
|
/>
|
||||||
|
{children}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue