fix: require PB_URL in production, fall back to localhost in dev only #5

Merged
ilia merged 2 commits from fix/pocketbase into main 2026-05-19 16:28:44 +00:00
Showing only changes of commit 6b15a0e658 - Show all commits
+9 -5
View File
@@ -8,11 +8,15 @@ import { SectionsAccordion } from '$widgets/SectionsAccordion';
* Optional catchall: `/` → first section, `/:slug` → that section. * Optional catchall: `/` → first section, `/:slug` → that section.
*/ */
export async function generateStaticParams() { export async function generateStaticParams() {
const { items: sections } = await getCollection<SectionRecord>('sections', { try {
sort: 'order', const { items: sections } = await getCollection<SectionRecord>('sections', {
tags: ['sections'], sort: 'order',
}); });
return [{}, ...sections.map((s) => ({ slug: [s.slug] }))]; return [{}, ...sections.map((s) => ({ slug: [s.slug] }))];
} catch (err) {
console.warn('[generateStaticParams] PocketBase unreachable at build — deferring to runtime ISR', err);
return [];
}
} }
type Props = { type Props = {