diff --git a/src/layouts/Post.astro b/src/layouts/Post.astro index 4b10a67..250cbe3 100644 --- a/src/layouts/Post.astro +++ b/src/layouts/Post.astro @@ -23,9 +23,40 @@ const dateFormat = new Intl.DateTimeFormat('en-US', { const wordCount = body.trim().split(/\s+/).filter(Boolean).length; const readingTime = Math.max(1, Math.round(wordCount / 200)); +const canonicalURL = new URL(Astro.url.pathname, Astro.site).toString(); +const heroImageURL = new URL(heroImage ?? '/og.png', Astro.site).toString(); +const structuredData = { + '@context': 'https://schema.org', + '@type': 'BlogPosting', + headline: title, + description, + image: heroImageURL, + datePublished: pubDate.toISOString(), + dateModified: (updatedDate ?? pubDate).toISOString(), + author: { + '@type': 'Person', + name: author, + }, + publisher: { + '@type': 'Organization', + name: 'Expressive Tea Team', + }, + mainEntityOfPage: canonicalURL, + ...(tags && tags.length > 0 ? { keywords: tags.join(', ') } : {}), +}; --- - +

← Back to the blog

diff --git a/src/pages/404.astro b/src/pages/404.astro index fba3855..ce2cd59 100644 --- a/src/pages/404.astro +++ b/src/pages/404.astro @@ -6,7 +6,7 @@ const title = '404 — Green Tea.'; const description = 'This page steeped too long. It’s gone — but the rest of the garden is right here.'; --- - +