Link the sources¶
A site links its repository, its package index and its other accounts as icons, in the navbar or in the footer. It also links each page to its source file, with edit and view buttons above the page and a link in the page tools.
Link the repository and other accounts¶
Set
icon_linksinhtml_theme_optionsinconf.py, one dict for each link:html_theme_options = { "icon_links": [ { "name": "GitHub", "url": "https://github.com/SamuelJennings/sphinx-daisyui", "icon": "github", }, { "name": "PyPI", "url": "https://pypi.org/project/sphinx-daisyui", "icon": "pypi", }, ], }
The
iconis the name of one of the icons the theme bundles. Options lists them. An unknown name makes the build warn, naming the entry and the icon, and the link is drawn with a generic link icon.To draw an image instead, set
typeand give the image asicon:{ "name": "Chat", "url": "https://chat.example.org", "icon": "chat.svg", "type": "local", }
With
"type": "local", theiconis a file in a directory listed inhtml_static_path, written relative to_staticor starting_static/. With"type": "url", it is the address of an image.Name the list for screen readers with
icon_links_label:html_theme_options = { "icon_links_label": "Project accounts", }
The default navbar now shows each link as an icon, and the list is named for screen readers.
Link Sphinx’s copy of the source¶
Name
sourcelinkinsecondary_sidebar_items:html_theme_options = { "secondary_sidebar_items": ["page-toc", "sourcelink"], }
Leave
html_show_sourcelinkandhtml_copy_sourceon. Their default is on.Build the site.
Each page now carries a Show source link to Sphinx’s copy of its source under _sources.
With either setting off, nothing is drawn. Components describes
the component.