--- import { getCollection } from 'astro:content'; import MainGridLayout from "@layouts/MainGridLayout.astro"; import ImageBox from "@components/misc/ImageBox.astro"; import {Icon} from "astro-icon/components"; import PostMetadata from "@components/PostMetadata.astro"; import Button from "@components/control/Button.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"; 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(); ---
{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.prevSlug && }