Repository navigation
docs: link previews, logo and favicon on the docs site - #2075
Open
amarkanday wants to merge 1 commit into
Open
amarkanday wants to merge 1 commit into
amarkanday wants to merge 1 commit into
Conversation
A link to a docs page showed no preview card, and the theme had no logo or
favicon.
- docs/overrides/main.html (theme.custom_dir; overrides/ is in exclude_docs
so it is not published) emits og:* and twitter:* tags from each page's
title and description, falling back to the site's values. og:image is the
absolute URL of the 1280x640 social card, with its size declared. Everything
that reads `page` is inside `{% if page %}`: page is None for 404.html, and
without the guard the strict build fails there.
- theme.logo is the small mark (heavier outline, for small sizes);
theme.favicon is favicon.svg, with favicon-32.png linked as a fallback.
The files are the Controlvar logo concept B, copied to docs/assets/brand/.
Part of #2038
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011kqtSDC7sd5ue3m6LuwdXV
Signed-off-by: amarkanday <a.markanday@gmail.com>
This branch has not been deployed
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.
Part of #2038
What and why
A link to a docs page shows no preview card, and the theme has no logo or favicon. This adds:
docs/overrides/main.html, set astheme.custom_dir, withoverrides/inexclude_docsso it is not published. It emitsog:site_name,og:type,og:title,og:description,og:url,og:image(with width and height),twitter:card(summary_large_image),twitter:title,twitter:descriptionandtwitter:image, from each page's title and description, falling back to the site's values. Titles are escaped once, soPower Analysis & Sample Sizerenders as&. Everything that readspagesits inside{% if page %}:pageis None while MkDocs renders404.html, and without the guard the strict build fails there.theme.logoiscontrolvar-mark-small.svg(the heavier-outline variant meant for small sizes), andtheme.faviconisfavicon.svg, withfavicon-32.pnglinked as a PNG fallback.og:imageiscontrolvar-social-1280x640.png, the file's real size. All four are the Controlvar logo concept B, copied todocs/assets/brand/.REUSE.toml, as the maintainer decided. Apache-2.0 grants no rights to the project's name or marks (section 6).This is the second of two docs-only pull requests for #2038. The first, #2061 (merged), added
robots.txtand the per-page descriptions these tags read.Verification
mkdocs build --strictexits 0 (same toolchain asscripts/docs_toolchain.sh). The two branches also build together (a throwaway merge, exit 0).site/: the home page, Quick Start and Power Analysis each carry one of every og/twitter tag (og:titlecount 1);og:imageishttps://docs.controlvar.com/assets/brand/controlvar-social-1280x640.png, present insite/assets/brand/and 1280 x 640 byfile;site/404.htmlis built and has no og tags;site/overrides/does not exist.{% if page %}/{% endif %}lines makesmkdocs build --strictexit 1 withjinja2.exceptions.UndefinedError: 'None' has no attribute 'meta'; restored, it exits 0.python scripts/doc_claims.py check: problems: 0.backend/tests/unit/infrastructure/test_docs_only_gate.py: 47 passed;scripts/classify_changes.pyon this diff printsdocs_only=true.scripts/check_dco.py origin/main HEAD: ok.NOT VERIFIED
Doc Examples (render)check is the only pull-request build of it.🤖 Generated with Claude Code
https://claude.ai/code/session_01NpxPyav9uBxNuiXsDvD8qn