diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 9000555..a9fcff8 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -106,6 +106,8 @@ const favicons: Favicon[] = siteConfig.favicon.length > 0 ? siteConfig.favicon : } + + diff --git a/src/layouts/MainGridLayout.astro b/src/layouts/MainGridLayout.astro index 827a099..e687d79 100644 --- a/src/layouts/MainGridLayout.astro +++ b/src/layouts/MainGridLayout.astro @@ -20,6 +20,7 @@ const enableBanner = siteConfig.banner.enable --- +
diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro index 46400e4..20bbe8c 100644 --- a/src/pages/posts/[...slug].astro +++ b/src/pages/posts/[...slug].astro @@ -11,6 +11,8 @@ import License from "@components/misc/License.astro"; import {licenseConfig} from "src/config"; import Markdown from "@components/misc/Markdown.astro"; import path from "path"; +import {profileConfig} from "../../config"; +import {formatDateToYYYYMMDD} from "../../utils/date-utils"; export async function getStaticPaths() { const blogEntries = await getCollection('posts', ({ data }) => { @@ -26,8 +28,24 @@ const { Content } = await entry.render(); const { remarkPluginFrontmatter } = await entry.render(); +const jsonLd = { + "@context": "https://schema.org", + "@type": "BlogPosting", + "headline": entry.data.title, + "description": entry.data.description || entry.data.title, + "keywords": entry.data.tags, + "author": { + "@type": "Person", + "name": profileConfig.name, + "url": Astro.site + }, + "datePublished": formatDateToYYYYMMDD(entry.data.published), + // TODO include cover image here +} + --- +