fix: getStaticPaths doesn't run unless in prerender mode
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user