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__;