From f4714839dd7c4d35f116eda2b458690a7f0360ff Mon Sep 17 00:00:00 2001 From: Avraham Sakal Date: Sat, 7 Dec 2024 21:56:42 -0500 Subject: [PATCH] fix: `getStaticPaths` doesn't run unless in `prerender` mode --- src/pages/journal/[...slug].astro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/journal/[...slug].astro b/src/pages/journal/[...slug].astro index 5c8d890..0f7fafe 100644 --- a/src/pages/journal/[...slug].astro +++ b/src/pages/journal/[...slug].astro @@ -5,6 +5,8 @@ import Heading from 'fulldev-ui/components/Heading.astro'; import Link from 'fulldev-ui/components/Link.astro'; import RegularText from './RegularText.astro'; +export const prerender = true; + // 1. Generate a new path for every collection entry export async function getStaticPaths() { const journalEntries = await getCollection('journal-entries'); @@ -16,6 +18,7 @@ export async function getStaticPaths() { // 2. For your template, you can get the entry directly from the prop const { journalEntry } = Astro.props; const { Content } = await journalEntry.render(); + ---