Show unpublished articles only if development mode is not enabled.
This commit is contained in:
parent
2ece6a8f59
commit
ed003faed5
1 changed files with 1 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ const base = import.meta.env.BASE_URL;
|
||||||
export const getStaticPaths = (async ({ paginate }) => {
|
export const getStaticPaths = (async ({ paginate }) => {
|
||||||
const notes = (await getCollection('notes')).sort(
|
const notes = (await getCollection('notes')).sort(
|
||||||
(a: CollectionEntry<'notes'>, b: CollectionEntry<'notes'>) => b.data.date.valueOf() - a.data.date.valueOf(),
|
(a: CollectionEntry<'notes'>, b: CollectionEntry<'notes'>) => b.data.date.valueOf() - a.data.date.valueOf(),
|
||||||
).filter((note) => (note.data.published));
|
).filter((note) => (note.data.published || import.meta.env.DEV));
|
||||||
return paginate(notes, { pageSize: 6 });
|
return paginate(notes, { pageSize: 6 });
|
||||||
}) satisfies GetStaticPaths;
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue