Skip to content

Commit

Permalink
Blog: build not-yet-public posts
Browse files Browse the repository at this point in the history
  • Loading branch information
vladh committed Dec 19, 2024
1 parent 53a727e commit 25b2ae0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/blog/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ARTICLE_QUERY = `*[_type == "article" && slug.current == $slug][0]{
author->{name, slug, avatar}
}`;
const article = await sanityClient.fetch<SanityDocument>(ARTICLE_QUERY, Astro.params);
if (!article || dayjs(article.publishDateTime).isAfter(dayjs().utc())) {
if (!article) {
return Astro.rewrite('/404');
}
Expand Down

0 comments on commit 25b2ae0

Please sign in to comment.