Skip to content

Render the nav and footer from one shared data file - #5460

Draft
dimitrieh wants to merge 3 commits into
mainfrom
shared-nav-data
Draft

Render the nav and footer from one shared data file#5460
dimitrieh wants to merge 3 commits into
mainfrom
shared-nav-data

Conversation

@dimitrieh

Copy link
Copy Markdown
Contributor

Description

The mega nav and footer link lists were maintained by hand in two places, src/_includes/layouts/base.njk and the Nuxt AppHeader/AppFooter components, and nothing failed when the two drifted. Both now render from src/_data/chrome.json, so adding or removing a page is one edit. Nuxt draws icons from the same SVG files Eleventy loads, via NavIcon and an explicit import map, giving the glyphs a single source too.

Verified as a rendering no-op on the Eleventy side: served header markup and the header plus footer link sets are byte identical across five sampled pages, with only three HTML comments dropped. The Nuxt render needs checking on the deploy preview.

nuxt/lib/chrome.test.mjs guards what can still drift, including nav entries that point at a redirected path. That is the gap that let the removed education page keep a live nav link: adding a 301 makes hyperlink accept the old URL, so a stale entry passes CI.

Related Issue(s)

Follows the leftover nav link found reviewing #5451. That PR removes the two education entries from the old markup; once it lands they come out of chrome.json instead.

Checklist

  • I have read the contribution guidelines
  • I have considered the performance impact of these changes
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
  • For blog PRs, an Art Request has been created (instructions)

Both renderers hand-maintain the same mega nav and footer link lists, so
removing a page needs the same edit in two places and CI does not catch a
miss. This lifts the labels, hrefs, icon keys and grid placement classes
out of the Eleventy layout into src/_data/chrome.json, generated from that
layout so the rendered markup is unchanged.

Named chrome.json rather than nav.json because base.njk already consumes a
page-level 'nav' variable for the article:section meta tag, which blog
frontmatter sets.
The mega nav and footer link lists were hand-maintained twice, once in the
Eleventy layout and once in the Nuxt components, and nothing failed when the
two drifted. Both now loop over src/_data/chrome.json, so adding or removing
a page is one edit.

Nuxt renders icons from the same SVG files Eleventy loads, through NavIcon and
an explicit import map, so the glyphs have a single source too. The imports are
listed rather than globbed because an eager glob would inline the whole icon
directory into the client bundle.

Verified as a rendering no-op on the Eleventy side: the served header markup and
the header plus footer link sets are byte identical across five sampled pages,
with only three HTML comments dropped from the footer.

nuxt/lib/chrome.test.mjs guards the parts that can still drift: icon keys that
resolve to no file, icon keys missing from the Nuxt map, the footer's deliberate
4/2/2/2 alignment split, and nav entries pointing at a path that redirects
elsewhere. That last one is the gap that let a removed page keep a live nav
link: adding a 301 makes the link checker accept the old URL, so a stale entry
passes CI.
The guards only guard if something runs them, and no workflow ran npm test.
Scoped to nuxt/lib so it does not pull in the handbook tests, which read real
git history that the shallow CI checkout does not have.
@dimitrieh
dimitrieh marked this pull request as draft July 31, 2026 16:07
@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploy Preview for flowforge-website ready!

Name Link
🔨 Latest commit ca32871
🔍 Latest deploy log https://app.netlify.com/projects/flowforge-website/deploys/6a6cc6ee8a32a70008d89369
😎 Deploy Preview https://deploy-preview-5460--flowforge-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 78 (🟢 up 16 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 91 (🟢 up 8 from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploy Preview for flowforge-website ready!

Name Link
🔨 Latest commit 649392a
🔍 Latest deploy log https://app.netlify.com/projects/flowforge-website/deploys/6a6cc726123556000844ce15
😎 Deploy Preview https://deploy-preview-5460--flowforge-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 71 (🟢 up 5 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 91 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant