Skip to content

Add banner and main landmarks to page_navbar() - #1357

Open
jcheng5 wants to merge 4 commits into
mainfrom
page-navbar-landmarks
Open

jcheng5 wants to merge 4 commits into
mainfrom
page-navbar-landmarks

Conversation

@jcheng5

@jcheng5 jcheng5 commented Sep 17, 2026

Copy link
Copy Markdown
Member

with @shelbylevel, and Posit Asisstant/Kimi K3

Fixes #1356

Wrap the top navigation bar in a <header> element so the page has a banner landmark, and render the content area as <main> when no sidebar is present (sidebar pages already get one via page_main_container()).

Both changes are made in page_navbar() rather than the shared navs_bar_() so that embedded navset_bar() instances don't produce inappropriate page-level landmarks. The <main> change is done in-place (the content div's tag is renamed) to preserve fill layout behavior.

Pull Request

Before you submit a pull request, please ensure you've completed the following checklist

  • Ensure there is an already open and relevant GitHub issue describing the problem in detail and you've already received some indication from the maintainers that they are welcome to a contribution to fix the problem. This helps us to prevent wasting anyone's time.

  • Add unit tests in the tests/testthat directory.

  • This project uses roxygen2 for documentation. If you've made changes to documentation, run devtools::document().

  • Run devtools::check() (or, equivalently, click on Build->Check Package in the RStudio IDE) to make sure your change did not add any messages, warnings, or errors.

    • Note there is a decent chance that some tests were already failing before your changes. Just make sure you haven't introduced any new ones.
  • Ensure your code changes follow the style outlined in http://r-pkgs.had.co.nz/style.html

  • Add an entry to NEWS.md concisely describing what you changed.

Wrap the top navigation bar in a <header> element so the page has a
banner landmark, and render the content area as <main> when no sidebar
is present (sidebar pages already get one via page_main_container()).

Both changes are made in page_navbar() rather than the shared
navs_bar_() so that embedded navset_bar() instances don't produce
inappropriate page-level landmarks. The <main> change is done in-place
(the content div's tag is renamed) to preserve fill layout behavior.
@jcheng5
jcheng5 requested a review from gadenbuie September 17, 2026 19:37
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.

page_navbar() pages are missing banner and main landmarks

1 participant