feat(footer): rework the footer into a site-wide bar - #89
Merged
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-headeris, 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:nameis optional and is the link's accessible name, defaulting to the service's own. An entry may giveicon: img/thing.svginstead ofserviceto point at an SVG underdocs_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.ymlnow setscopyrightand two social links, so every build exercises the option.Icons
scripts/vendor-icons.mjspulls 29 curated marks out ofsimple-iconsand generatespartials/social-icons.html. Same bargainscripts/vendor-css.mjsmakes: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:Neither
octiconsnorlucideships brand marks, so the row is Simple Icons whatevertheme.iconsays — 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_urlis 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, behindshow_metadata_edit. Theconfig.repo_urlfallback stays in the footer: a site withrepo_urlbut noedit_uristill 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 --strictfor the docs site, all three examples and the offline configdocs_diricon,show_footer_generator: false, norepo_urlpage) falls back to the repository link; translated pages render the new string with the links in the right places, including zh and hi word ordernpm run vendorandpybabel compileare both idempotent against the committed bytes, which is what the two CI drift checks compareNot 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