fix: Posts with empty series

This commit is contained in:
Leni Aniva 2025-01-25 15:36:12 -08:00
parent e7984f9c33
commit 662a298b28
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
1 changed files with 5 additions and 5 deletions

View File

@ -16,13 +16,13 @@ export const load: PageLoad = async ({ params }) => {
prevTitle?: string,
nextSlug?: string,
nextTitle?: string,
}[] = await Promise.all(post.metadata.series.map(async (series: string) => {
}[] = await Promise.all((metadata.series || []).map(async (series: string) => {
const postInSeries: Post[] = await getPosts({ series });
let prevSlug = null;
let prevTitle = null;
let nextSlug = null;
let nextTitle = null;
let prevSlug = undefined;
let prevTitle = undefined;
let nextSlug = undefined;
let nextTitle = undefined;
for (const p of postInSeries) {
if (p.date > metadata.date) {