diff --git a/src/components/ArticleList.astro b/src/components/ArticleList.astro index 7206079..34fd9cf 100644 --- a/src/components/ArticleList.astro +++ b/src/components/ArticleList.astro @@ -2,6 +2,12 @@ // © 2024 Vlad-Stefan Harbuz // SPDX-License-Identifier: Apache-2.0 +interface Props { + showDrafts?: string; +} + +const { showDrafts } = Astro.props; + import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; dayjs.extend(utc); @@ -19,7 +25,13 @@ const ARTICLES_QUERY = `*[_type == "article"]|order(publishDateTime desc){ }`; const articles = (await sanityClient.fetch(ARTICLES_QUERY)) - .filter((a) => dayjs(a.publishDateTime).isBefore(dayjs().utc())); + .filter((a) => { + if (showDrafts) { + return !dayjs(a.publishDateTime).isBefore(dayjs().utc()); + } else { + return dayjs(a.publishDateTime).isBefore(dayjs().utc()); + } + }); ---
diff --git a/src/pages/blog/drafts.astro b/src/pages/blog/drafts.astro new file mode 100644 index 0000000..7b14cc1 --- /dev/null +++ b/src/pages/blog/drafts.astro @@ -0,0 +1,31 @@ +--- +// © 2025 Functional Software, Inc. dba Sentry +// SPDX-License-Identifier: Apache-2.0 + +import ArticleList from "../../components/ArticleList.astro"; +import Blob from "../../components/Blob.astro"; +import Button from "../../components/Button.astro"; +import Layout from "../../layouts/Layout.astro"; +--- + + +
+ + +
+
+ + + + + +
+
+
+

Drafts

+
+ +
+
+
+