From 2edff97f6727bf0e67de91b971ef1d0baadc0341 Mon Sep 17 00:00:00 2001 From: Niko Date: Sun, 28 Jun 2026 10:18:48 +0200 Subject: [PATCH] Add auto footer links --- src/components/Footer.astro | 11 +++++++- src/components/Header.astro | 40 ++------------------------ src/utils/nav.ts | 56 +++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 39 deletions(-) create mode 100644 src/utils/nav.ts diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 209de3e03..06e90c78e 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -1,8 +1,17 @@ --- import SocialLinks from "@components/SocialLinks.astro"; import { FOOTER_COLUMNS, TERMS, SOCIALS } from "@data/nav"; +import { buildLinkChecker } from "@utils/nav"; import EPSLogo from "/public/theme/eps-logo.svg"; +const linkExists = await buildLinkChecker(); + +// Filter footer columns to only show links that point to existing pages +const activeFooterColumns = FOOTER_COLUMNS.map((col) => ({ + ...col, + items: col.items.filter((item) => linkExists(item.url)), +})).filter((col) => col.items.length > 0); + const buildTimestamp = __TIMESTAMP__; const gitVersion = __GIT_VERSION__; --- @@ -18,7 +27,7 @@ const gitVersion = __GIT_VERSION__;