From 631416984c79b8f7d5cf099c558e2e30e2206b36 Mon Sep 17 00:00:00 2001 From: eggy Date: Mon, 31 Oct 2022 14:18:14 -0400 Subject: [PATCH] feat: add filter to main page --- pages/blog.vue | 18 ++++++++++++++++++ pages/stories.vue | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/pages/blog.vue b/pages/blog.vue index 89230df..32ce27c 100644 --- a/pages/blog.vue +++ b/pages/blog.vue @@ -9,6 +9,14 @@ const docs = await queryContent("/blog") .sort({ date: -1 }) .where({ _draft: false }) .find(); + +const tags = new Set( + docs + .map((p) => p.tags) + .flat() + .filter((p) => !p.includes(" ")) + .sort() +);