--- import path from 'node:path' import { getCollection } from 'astro:content' import License from '@components/misc/License.astro' import Markdown from '@components/misc/Markdown.astro' import I18nKey from '@i18n/i18nKey' import { i18n } from '@i18n/translation' import MainGridLayout from '@layouts/MainGridLayout.astro' import { getDir, getPostUrlBySlug } from '@utils/url-utils' import { Icon } from 'astro-icon/components' import { licenseConfig } from 'src/config' import PostMetadata from '../../components/PostMeta.astro' import ImageWrapper from '../../components/misc/ImageWrapper.astro' import { profileConfig, siteConfig } 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), inLanguage: (entry.data.language ? entry.data.language.replace('_', '-') : siteConfig.lang.replace('_', '-')), // 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} }