diff --git a/src/components/get-posts.ts b/src/components/get-posts.ts index 86da888..a89e461 100644 --- a/src/components/get-posts.ts +++ b/src/components/get-posts.ts @@ -43,3 +43,12 @@ export const getPublishablePostsBySection = async () => { return groups; }; + +export const getDraftPosts = async () => { + const posts = await getCollection( + "docs", + (post) => post.data.draft || !post.data.pagefind + ); + + return posts.sort((postA, postB) => getTime(postB) - getTime(postA)); +}; diff --git a/src/content/docs/posts/drafts.mdx b/src/content/docs/posts/drafts.mdx new file mode 100644 index 0000000..bb9d063 --- /dev/null +++ b/src/content/docs/posts/drafts.mdx @@ -0,0 +1,11 @@ +--- +title: Drafts +template: splash +--- + +import LinkToPost from "@components/LinkToPost.astro"; +import { getDraftPosts } from "@components/get-posts"; + +List of all posts that are in the process, but not ready to be open to public: + +{(await getDraftPosts()).slice(0, 10).map((post) => )}