diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro
index 3248e1a..85b467d 100644
--- a/src/pages/posts/[...slug].astro
+++ b/src/pages/posts/[...slug].astro
@@ -28,6 +28,11 @@ const { Content, headings } = await entry.render();
const { remarkPluginFrontmatter } = await entry.render();
+const postUrl = new URL(getPostUrlBySlug(entry.slug), Astro.site).href;
+const coverImage = /^https?:\/\//.test(entry.data.image)
+ ? entry.data.image
+ : undefined;
+
const jsonLd = {
"@context": "https://schema.org",
"@type": "BlogPosting",
@@ -40,10 +45,17 @@ const jsonLd = {
url: Astro.site,
},
datePublished: formatDateToYYYYMMDD(entry.data.published),
+ ...(entry.data.updated && {
+ dateModified: formatDateToYYYYMMDD(entry.data.updated),
+ }),
+ ...(coverImage && { image: coverImage }),
+ mainEntityOfPage: {
+ "@type": "WebPage",
+ "@id": postUrl,
+ },
inLanguage: entry.data.lang
? entry.data.lang.replace("_", "-")
: siteConfig.lang.replace("_", "-"),
- // TODO include cover image here
};
---
diff --git a/src/pages/series.astro b/src/pages/series.astro
index 6a99dce..4ddea04 100644
--- a/src/pages/series.astro
+++ b/src/pages/series.astro
@@ -5,6 +5,6 @@ import { i18n } from '@i18n/translation'
import I18nKey from '@i18n/i18nKey'
---
-
+
\ No newline at end of file