Skip to content

Commit

Permalink
add filter so drafts are not displayed on index
Browse files Browse the repository at this point in the history
  • Loading branch information
stirlhoss committed Oct 15, 2024
1 parent 8445a37 commit 392e984
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/blog/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
import Layout from '../../layouts/Layout.astro'
import BlogCard from '../../components/BlogCard.astro'
const allPosts = await Astro.glob('./*.md')
const filteredPosts = allPosts.filter((post) => !post.frontmatter.draft)
---

<Layout title="Blog">
<main>
<h1> BABLR Blog </h1>
{allPosts.map((post) => <BlogCard
{filteredPosts.map((post) => <BlogCard
href={post.url}
title={post.frontmatter.title}
date={post.frontmatter.date}
Expand Down

0 comments on commit 392e984

Please sign in to comment.