Skip to content

Docs: take sidebar group order from frontmatter, not a hardcoded list - #5513

Merged
ZJvandeWeg merged 2 commits into
mainfrom
docs-nav-group-order
Aug 5, 2026
Merged

Docs: take sidebar group order from frontmatter, not a hardcoded list#5513
ZJvandeWeg merged 2 commits into
mainfrom
docs-nav-group-order

Conversation

@dimitrieh

Copy link
Copy Markdown
Contributor

Description

The docs sidebar ranked its group headings with a GROUP_ORDER array in nuxt/composables/useDocsNav.ts, so adding, renaming or reordering a group meant a change here even though the docs live in FlowFuse/flowfuse and already declare the group names in navGroup.

A group now takes the lowest navGroupOrder declared by its sections, so the docs repo owns the whole structure. Groups nobody ranks fall to the end, sorted by name. The builder moves to nuxt/lib/docs-nav.mjs as plain JS (same reason as docs-sync.mjs) so npm test covers it; the composable keeps the types and stays the import surface for DocsLeftNav.

Depends on FlowFuse/flowfuse#8069, which adds the frontmatter. Merge that first: until it lands, docs are cloned from flowfuse main with no navGroupOrder, and the preview here shows the groups alphabetically.

Verified against the real docs tree with the flowfuse branch synced: identical nav to the GROUP_ORDER implementation across all 115 docs pages.

Related Issue(s)

None.

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)

The docs sidebar ranked its group headings with a GROUP_ORDER array in
useDocsNav.ts, so adding, renaming or reordering a group meant a change
here even though the docs themselves live in FlowFuse/flowfuse and
already declare the group names in navGroup.

A group now takes the lowest navGroupOrder declared by its sections, so
the whole docs structure is owned by the docs repo. Groups nobody ranks
fall to the end, sorted by name.

The builder moves to nuxt/lib/docs-nav.mjs as plain JS, matching
docs-sync.mjs, so `npm test` can cover it; the composable keeps the
types and stays the import surface for DocsLeftNav.

Verified against the real docs tree: identical nav to the GROUP_ORDER
implementation for all 115 pages.
@dimitrieh

Copy link
Copy Markdown
Contributor Author

Needs a review after FlowFuse/flowfuse#8069 merges and here the preview gets rebuilt

@dimitrieh
dimitrieh marked this pull request as draft August 5, 2026 10:17
@dimitrieh

dimitrieh commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Waiting on this one to be merged first

@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy Preview for flowforge-website ready!

Name Link
🔨 Latest commit 726ec8f
🔍 Latest deploy log https://app.netlify.com/projects/flowforge-website/deploys/6a731da4a67c9700085b0071
😎 Deploy Preview https://deploy-preview-5513--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: 63 (🔴 down 4 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (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.

@dimitrieh

Copy link
Copy Markdown
Contributor Author

Preview affected pages:

The left nav is shared by every /docs page, so the list above is one page per group heading rather than all 115.

Note on what the preview shows: this build cloned docs from flowfuse main, which does not carry navGroupOrder yet, so the groups render alphabetically (Contributing, Device Agent, Cloud, Self-Hosted, User Manuals, Support). That is the documented fallback for unranked groups, not a regression. Merging FlowFuse/flowfuse#8069 first restores the intended order; verified locally by building this branch against that docs branch, which reproduces the current order exactly.

@dimitrieh

Copy link
Copy Markdown
Contributor Author

@dimitrieh
dimitrieh marked this pull request as ready for review August 5, 2026 11:23
@dimitrieh

Copy link
Copy Markdown
Contributor Author

@Yndira-E this is about moving logic of how the left hand navigation for docs is defined from the website to the documentation so there is an SSOT. With the docs to nuxt migration this got tangled up, and currently part of the nav is hardcoded in https://github.com/FlowFuse/website.

FlowFuse/flowfuse#8069 is merged, now we can look at this do this one :)

@dimitrieh

Copy link
Copy Markdown
Contributor Author

This is in preparation of structural documentation changes coming up which then only need to hit one repository.

@ZJvandeWeg
ZJvandeWeg merged commit c46c91d into main Aug 5, 2026
7 checks passed
@ZJvandeWeg
ZJvandeWeg deleted the docs-nav-group-order branch August 5, 2026 19:18
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.

2 participants