Skip to content

Commit 8a4fc35

Browse files
feat: allow creation of unlisted posts
1 parent 9d99de6 commit 8a4fc35

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/share/[...postSlug]/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default async function PostPage({ params }: PostProps) {
2727
const slug = params?.postSlug?.join("/");
2828
const post = posts.find((post: Post) => post.extractedSlug === slug);
2929

30-
if (!post || !post.published) {
30+
if (!post || (!post.published && !post.publishedUnlisted)) {
3131
notFound();
3232
}
3333

velite.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const posts = defineCollection({
6767
description: s.string().max(200).optional(),
6868
date: s.isodate(),
6969
published: s.boolean().default(true),
70+
publishedUnlisted: s.boolean().default(false),
7071
featured: s.boolean().default(false),
7172
tags: s.array(s.string()).default([]),
7273
body: s.mdx(),

0 commit comments

Comments
 (0)