Skip to content

feat: version banners for dev/legacy, per-branch edit links - #18

Merged
pfeerick merged 1 commit into
edgetx_2.12from
version-banners
Oct 23, 2026
Merged

pfeerick merged 1 commit into
edgetx_2.12from
version-banners

Conversation

@pfeerick

Copy link
Copy Markdown
Member

Summary

Version banners

  • The legacy banner never showed on the live site. legacy-version-banner.js read extra.legacy_version from #__config, but Material only puts base, features, search, translations and version there, so the check always bailed out.
  • The script now works out the current version at runtime. It resolves config.base against the page URL to get /<version>/, then looks that version up in mike's versions.json:
    • dev shows a "Development version" banner: These docs track EdgeTX development and may describe features or changes that are not in a released version yet, with a link to the latest release docs.
    • Any version other than the latest alias shows a "Legacy version" banner with a link to /latest/. When 2.13 ships, 2.12 picks this up automatically.
    • latest shows no banner. With plain mkdocs serve there's no versions.json, so there's no banner either.
  • Because nothing depends on per-version config, main can stay an exact copy of edgetx_2.12 (see chore: make main a copy of edgetx_2.12 (MkDocs, published as dev) #17). The legacy_version config blocks were never read, so I removed them from mkdocs.yml, import_legacy_gitbook.py and prepare_branch_site.py.

"Edit this page" goes to the right branch

  • Turned on content.action.edit. Without it, Material 9 never renders the edit button, so the site had no edit links at all.
  • edit_uri is now !ENV [DOCS_EDIT_URI, "edit/edgetx_2.12/website/md-docs/"]. The publish workflow sets DOCS_EDIT_URI to edit/${{ github.ref_name }}/website/md-docs/, so /dev/ edits open main and /2.12/ edits open edgetx_2.12. Legacy imports still set edit_uri: "", because their source is a temporary workspace, so they get no edit link.

Testing

  • Built a throwaway local mike branch with 2.12 (latest), dev and 2.8 and checked it with mike serve:
    • /dev/: dev banner, edit link points to edit/main/....
    • /2.8/: legacy banner, link goes to /latest/, no edit button.
    • /latest/ and /2.12/: no banner, edit link points to edit/edgetx_2.12/....
  • uv run mkdocs build --strict passes.

After merging

  • Merge edgetx_2.12 into main (chore: make main a copy of edgetx_2.12 (MkDocs, published as dev) #17, or a follow-up PR) so dev gets the same files.
  • The legacy versions on gh-pages were built with the old script. Re-import and mike deploy 2.4–2.11, then re-run the publish workflow, so their banners show up.
  • Generated API reference pages will show an edit button too. Edits there should go to docs-system/overlays/ or the firmware's /*luadoc*/ comments (see CONTRIBUTING.md). The generated-file marker at the top of those files says so, but contributors will land on the generated file first.

🤖 Generated with Claude Code

The legacy banner never rendered: it read extra.legacy_version from
#__config, which Material doesn't populate. The banner script now works
out the current version from the URL and mike's versions.json, showing a
"Development version" notice on dev and a "Legacy version" notice (with a
link to latest) on anything that isn't the latest alias. No per-version
config is involved, so main can stay a straight copy of edgetx_2.12.

Also turn on content.action.edit (Material hides the edit button without
it) and take edit_uri from DOCS_EDIT_URI, which the publish workflow sets
to the branch being built, so "Edit this page" on /dev/ opens main and on
/2.12/ opens edgetx_2.12.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pfeerick
pfeerick added this pull request to stack #22 October 23, 2026 09:07
@pfeerick
pfeerick merged commit 7206b31 into edgetx_2.12 Oct 23, 2026
1 check passed
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