fix: getStaticPaths doesn't run unless in prerender mode

This commit is contained in:
Avraham Sakal
2024-12-07 21:56:42 -05:00
parent 8532af4c04
commit f4714839dd
+3
View File
@@ -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();
---
<Layout title={journalEntry.data.title}>
<main>