Skip to content

feat(footer): rework the footer into a site-wide bar - #89

Merged
olegshulyakov merged 2 commits into
mainfrom
feat/footer-rework
Sep 20, 2026
Merged

olegshulyakov merged 2 commits into
mainfrom
feat/footer-rework

Conversation

@olegshulyakov

Copy link
Copy Markdown
Owner

Closes #88, closes #81.

The footer was rendered inside <main>, so it was boxed into the article column and sat to the left of the page rather than under it — a page footnote, not a site footer. It is now a full-width bar under the whole layout, edge to edge the way .primer-header is, on the same inset surface.

What it carries

Copyright, then "Made with mkdocs-primer and MkDocs". The attribution line is on by default and comes off with show_footer_generator: false.

A social row, theme.social:

theme:
  social:
    - service: github
      link: https://github.com/you/your-project
    - service: mastodon
      link: https://fosstodon.org/@you
      name: Follow the project on Mastodon

name is optional and is the link's accessible name, defaulting to the service's own. An entry may give icon: img/thing.svg instead of service to point at an SVG under docs_dir, so a service outside the registry is never a wall — which is also the route for LinkedIn and Slack, both withdrawn from Simple Icons at the trademark holder's request. An entry naming a service that does not exist renders its name as visible text rather than vanishing, so a typo is noticeable.

This site's own mkdocs.yml now sets copyright and two social links, so every build exercises the option.

Icons

scripts/vendor-icons.mjs pulls 29 curated marks out of simple-icons and generates partials/social-icons.html. Same bargain scripts/vendor-css.mjs makes: npm run vendor, commit the diff, CI fails on drift. The script refuses to build if an upstream mark stops being a lone <path>, rather than shipping half a logo.

Curated rather than complete, measured against simple-icons@16.32.0:

size
current wheel 163 KB
all 3461 icons +4.76 MB (~1.9 MB in the wheel)
the 29 shipped 23 KB

Neither octicons nor lucide ships brand marks, so the row is Simple Icons whatever theme.icon says — which also keeps a dozen logos looking like one row. The CC0 grant and the trademark caveat are recorded in the generated file's header and in the docs.

Edit link moved

page.edit_url is a fact about the page, and a site-wide bar should not change from page to page, so Improve this page joins the created/updated/reading-time/authors byline under the title, behind show_metadata_edit. The config.repo_url fallback stays in the footer: a site with repo_url but no edit_uri still says where its source is, on every page.

Also

The back-to-top button floats over the bottom-right corner, which is now where the social row ends — it covered the last icon and took its click. The bar reserves that column at its trailing edge.

Verified

  • mkdocs build --strict for the docs site, all three examples and the offline config
  • A plugin-free site covering the edge cases: unknown service, docs_dir icon, show_footer_generator: false, no repo_url
  • 404 (no page) falls back to the repository link; translated pages render the new string with the links in the right places, including zh and hi word order
  • npm run vendor and pybabel compile are both idempotent against the committed bytes, which is what the two CI drift checks compare
  • Looked at in light and dark, desktop and mobile

Not touched: docs/guide/configuration.*.md, the translated copies of the configuration page. They already do not track the metadata options added in #87, so bringing them up to date is its own job.

🤖 Generated with Claude Code

olegshulyakov and others added 2 commits September 20, 2026 12:18
- Move the footer out of <main> to under the whole layout, edge to edge
  the way the header is: it belongs to the site, not to the article column
- Add "Made with mkdocs-primer and MkDocs" under the copyright, off with
  `show_footer_generator: false`
- Add `theme.social`, a row of icon links drawn from a curated set of
  Simple Icons vendored by `npm run vendor`; an entry may point `icon` at
  an SVG under docs_dir for a service the set does not carry
- Move "Improve this page" into the byline under the page title, behind
  `show_metadata_edit`, so the bar reads the same on every page; the
  `repo_url` fallback stays in the footer for a site with no `edit_uri`
- Reserve the back-to-top button's column at the bar's trailing edge, or
  it covers the last icon in the social row

Closes #81
Closes #88

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ks in a new tab

- Put "Improve this page" back in the footer, after the copyright and a
  separator, rather than in the byline under the title: with it there the
  byline ran to two lines on a narrow window
- Open every footer link in a tab of its own, and say so in a hidden
  suffix -- a new tab takes the Back button away from a reader who did
  not ask for one, and someone who cannot see it happen has nothing else
  to tell them it did
- Widen the bar's horizontal padding past the header's gutter, so the
  text does not run out to the glass under two columns that do not

`show_metadata_edit` goes with the move; partials/metadata.html is back
to what it was before this branch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@olegshulyakov
olegshulyakov merged commit 2f26404 into main Sep 20, 2026
4 checks 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.

Rework the footer into a site-wide bar with a "Made with" line Footer has no social links row

1 participant