From fe7dcb65c4c7cc43b84f9db5907fb3636c04c4fc Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Fri, 7 Mar 2025 11:47:40 +0100 Subject: [PATCH] All tags starting with #meta are now considered meta pages --- web/components/page_navigator.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/web/components/page_navigator.tsx b/web/components/page_navigator.tsx index e6bc02a1..ac2a3997 100644 --- a/web/components/page_navigator.tsx +++ b/web/components/page_navigator.tsx @@ -220,16 +220,10 @@ export function PageNavigator({ }); } // Remove pages that are tagged as templates or meta - options = options.filter((pageMeta) => { - return !pageMeta.tags?.includes("template") && - !pageMeta.tags?.includes("meta"); - }); + options = options.filter((pageMeta) => !isMetaPageOption(pageMeta)); } else if (mode === "meta") { - // Filter on pages tagged with "template" or "meta" - options = options.filter((pageMeta) => { - return pageMeta.tags?.includes("template") || - pageMeta.tags?.includes("meta"); - }); + // Filter on pages tagged with "template" or "meta" prefix + options = options.filter(isMetaPageOption); } if (mode !== "all") { @@ -253,3 +247,8 @@ export function PageNavigator({ /> ); } + +function isMetaPageOption(page: FilterOption) { + return page.tags?.includes("template") || + page.tags?.find((tag: string) => tag.startsWith("meta")); +}