diff --git a/src/pages/search.astro b/src/pages/search.astro index 9d7c85a..21827c9 100644 --- a/src/pages/search.astro +++ b/src/pages/search.astro @@ -13,12 +13,14 @@ localStorage.setItem("myCat", "Tom"); const posts = await Astro.glob("../contents/*.md"); // List of items to search in -const searchList = posts.map(({ frontmatter }) => ({ - title: frontmatter.title, - description: frontmatter.description, - frontmatter, - slug: frontmatter.slug, -})); +const searchList = posts + .filter(({ frontmatter }) => !frontmatter.draft) + .map(({ frontmatter }) => ({ + title: frontmatter.title, + description: frontmatter.description, + frontmatter, + slug: frontmatter.slug, + })); ---