Add filter for draft posts

This commit is contained in:
Sat Naing
2022-09-22 23:37:09 +06:30
parent b8b7aaef7d
commit 00689f1cba
+3 -1
View File
@@ -13,7 +13,9 @@ localStorage.setItem("myCat", "Tom");
const posts = await Astro.glob<Frontmatter>("../contents/*.md"); const posts = await Astro.glob<Frontmatter>("../contents/*.md");
// List of items to search in // List of items to search in
const searchList = posts.map(({ frontmatter }) => ({ const searchList = posts
.filter(({ frontmatter }) => !frontmatter.draft)
.map(({ frontmatter }) => ({
title: frontmatter.title, title: frontmatter.title,
description: frontmatter.description, description: frontmatter.description,
frontmatter, frontmatter,