--- import { IconStar } from "@tabler/icons-react"; import { fetchAllPosts } from "@data/posts.js"; import { fetchAnalyticsData } from "@data/analytics.js"; import { fetchLinks } from "@data/links.js"; import { fetchGlobalData } from "@utils/data/global/index.js"; import { md } from "@utils/helpers/general.js"; import { getPopularPosts } from "@utils/getPopularPosts.js"; const analytics = await fetchAnalyticsData(); const links = await fetchLinks(); const posts = await fetchAllPosts(); const popularPosts = getPopularPosts(posts, analytics); import AddonLinks from "@components/blocks/links/AddonLinks.astro"; import AssociatedMedia from "@components/blocks/AssociatedMedia.astro"; import BlockRenderer from "@components/blocks/BlockRenderer.astro"; import Coffee from "@components/blocks/banners/Coffee.astro"; import Layout from "@layouts/Layout.astro"; import Mastodon from "@components/blocks/banners/Mastodon.astro"; import OldPost from "@components/blocks/banners/OldPost.astro"; export const prerender = true; export async function getStaticPaths() { const posts = await fetchAllPosts(); return posts.map((post) => { const match = post.url.match(/^\/posts\/(\d{4})\/(.+)$/); if (!match) throw new Error(`Invalid post URL: ${post.url}`); const [, year, title] = match; return { params: { year, title }, props: { post }, }; }); } const { post } = Astro.props; const { globals } = await fetchGlobalData(Astro); const { year, title } = Astro.params; const currentUrl = Astro.url.pathname; const htmlContent = md(post.content); ---

{post.title}

{post.old_post && } { post.image && ( {post.image_alt?.replace(/['"]/g, ) }
{ post.blocks && post.blocks.map((block) => ) } {post.mastodon_url && }