Repository navigation
Add favicon to docs - #2317
Merged
Merged
Add favicon to docs#2317
Conversation
The docs config came from a 2013 sphinx-quickstart and never set html_favicon. Generate a square 180x180 transparent canvas holding the folium leaf, and export a favicon.ico with 16, 32, and 48 px variants.
Collaborator
|
@williambdean Again, thanks! |
This branch was successfully 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.
Summary
The docs site currently has no favicon:
docs/conf.pywas scaffolded bysphinx-quickstartin 2013 and thehtml_faviconoption has satcommented out ever since.
This PR adds a favicon so the browser tab shows the folium leaf instead
of a generic page icon:
docs/_static/favicon.ico: the existing leaf logo centered on asquare transparent canvas, exported at 16, 32, and 48 px
docs/conf.py: sethtml_favicon = "_static/favicon.ico"Details
The source
folium_logo.pngis 100x180 (and non-square), so it can't beused directly. The favicon pads it to a 180x180 transparent square
rather than cropping, to keep the full leaf shape.
html_faviconaccepts the path relative to the source directory;pydata-sphinx-theme emits the
<link rel="icon">tag, and the file ispicked up through the existing
html_static_path = ["_static"]setting.
Verified locally: full
make htmlbuild succeeds and the builtindex.htmlcontains<link rel="icon" href="_static/favicon.ico"/>.Script used to generate
favicon.icofromfolium_logo.pngRan once with
uv run(script has inline PEP 723 deps); the outputfavicon.icois committed, so the script isn't part of the repo.