Skip to content

Add cross-site footer links and rewrite logo to main site#19

Merged
neuromechanist merged 2 commits into
mainfrom
feature/cross-site-nav-footer
Apr 14, 2026
Merged

Add cross-site footer links and rewrite logo to main site#19
neuromechanist merged 2 commits into
mainfrom
feature/cross-site-nav-footer

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

  • Shared overrides/ applied to both MkDocs configs (docs.osc.earth, courses.osc.earth).
  • Header logo / site title now link to https://osc.earth (applied on each instant-nav swap via Material's document$ observable).
  • Footer shows three-site nav (osc.earth · docs.osc.earth · courses.osc.earth) above copyright and Material generator line.

Files

  • overrides/main.html — extends base.html; inlines footer-link CSS (extrahead) and logo-rewrite JS (libs).
  • overrides/partials/copyright.html — custom copyright partial with cross-site links.

Test plan

  • uv run mkdocs build passes
  • uv run mkdocs build -f mkdocs-courses.yml passes
  • Built HTML contains three href=https://*.osc.earth footer links on both sites
  • Manual: mkdocs serve on both configs; click logo navigates to osc.earth; footer links render and work

Shared overrides/ applies to both mkdocs.yml (docs.osc.earth) and
mkdocs-courses.yml (courses.osc.earth).

- main.html: extends base; inlines JS that rewrites header logo and
  site-title href to https://osc.earth on each instant-nav swap via
  Material's document$ observable; inlines footer link styles.
- partials/copyright.html: adds three-site footer nav
  (osc.earth, docs.osc.earth, courses.osc.earth) above copyright and
  Material generator line.
- Replace logo-rewrite JS with Material's native extra.homepage config
  in both mkdocs.yml and mkdocs-courses.yml. Eliminates flash-of-wrong
  href on initial load and removes fragile DOM selectors.
- Drop the custom libs block from main.html; only CSS remains.
- Move md-copyright__highlight back to wrap the copyright text (matches
  Material default); drop the non-existent md-copyright__generator
  wrapper around the Made-with-Material line.
- Wrap cross-site links in nav + ul/li with aria-label; separator now
  rendered via CSS ::before so screen readers see a clean list.
@neuromechanist

Copy link
Copy Markdown
Member Author

Review findings addressed

Ran /review-pr with code-reviewer, silent-failure-hunter, and comment-analyzer agents. Summary of actions:

Applied

  • Flash-of-wrong-href / fragile JS (code-reviewer suggestion 5): removed the logo-rewrite JS entirely and switched to Material's native extra.homepage: https://osc.earth in both mkdocs.yml and mkdocs-courses.yml. This sets the header and nav-drawer logo href at build time, eliminating both the FOUC and the document$/selector fragility silent-failure-hunter flagged.
  • md-copyright__highlight misuse (code-reviewer important 2): moved the class back to wrap the copyright text so Material's default __highlight styling applies. The sitelinks row now uses only .md-osc-sitelinks.
  • Non-existent md-copyright__generator wrapper (code-reviewer important 1): dropped the wrapper <div> so "Made with Material for MkDocs" renders as a bare text node, matching upstream.
  • Accessibility (code-reviewer suggestion 4): wrapped the three links in <nav aria-label="Open Science Collective sites"><ul class="md-osc-sitelinks"> with one <li> per site; the · separator is now a CSS ::before on li + li so screen readers hear a clean three-item list.
  • Comment rot / missing upstream pointer (comment-analyzer): updated the Jinja header comment in partials/copyright.html to note that it shadows Material's default and link to the upstream file maintainers should diff against on theme upgrades.

Not applied (intentional)

  • console.warn on zero-matched selectors (silent-failure-hunter optional): no longer relevant now that the JS is gone.

Built both configs with --strict; verified md-logo anchor href is https://osc.earth on docs.osc.earth and courses.osc.earth for both header and nav-drawer logos, and that the footer nav renders with three links.

@neuromechanist
neuromechanist merged commit bb038e1 into main Apr 14, 2026
@neuromechanist
neuromechanist deleted the feature/cross-site-nav-footer branch April 14, 2026 18:48
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