--- import { getCollection } from 'astro:content'; import MainGridLayout from "@layouts/MainGridLayout.astro"; import ImageWrapper from "../../components/misc/ImageWrapper.astro"; import {Icon} from "astro-icon/components"; import PostMetadata from "../../components/PostMeta.astro"; import {i18n} from "@i18n/translation"; import I18nKey from "@i18n/i18nKey"; import {getDir, getPostUrlBySlug} from "@utils/url-utils"; 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 }) => { return import.meta.env.PROD ? data.draft !== true : true; }); return blogEntries.map(entry => ({ params: { slug: entry.slug }, props: { entry }, })); } const { entry } = Astro.props; 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 } --- {remarkPluginFrontmatter.words} {" " + i18n(I18nKey.wordsCount)} {remarkPluginFrontmatter.minutes} {" " + i18n(I18nKey.minutesCount)} {entry.data.title} {!entry.data.image && } {entry.data.image && } {licenseConfig.enable && } {entry.data.nextSlug && {entry.data.nextTitle} } {entry.data.prevSlug && {entry.data.prevTitle} }