Skip to content

Commit 9ffa6ee

Browse files
committed
chore: also hide draft posts
1 parent 6a4c60f commit 9ffa6ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/markdoc/layouts/Post.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
| boolean;
4040
export let lastUpdated: string;
4141
42-
const posts = getContext<PostsData[]>('posts')?.filter((post) => !post.unlisted);
42+
const posts = getContext<PostsData[]>('posts')?.filter(
43+
(post) => !(post.unlisted ?? false) && !(post.draft ?? false)
44+
);
4345
const authors = getContext<AuthorData[]>('authors');
4446
const authorData = authors.find((a) => a.slug === author);
4547

0 commit comments

Comments
 (0)