File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 3030 "search" : {},
3131 },
3232 "icon" : {},
33+ "pdf_url" : "" ,
3334 "repo_url" : "" ,
3435 "edit_uri" : "" ,
3536 "globaltoc_collapse" : True ,
@@ -214,6 +215,7 @@ def html_page_context(
214215 "theme" : theme_options ,
215216 "site_url" : theme_options .get ("site_url" ),
216217 "site_name" : context ["docstitle" ],
218+ "pdf_url" : theme_options .get ("pdf_url" ),
217219 "repo_url" : theme_options .get ("repo_url" ),
218220 "repo_name" : theme_options .get ("repo_name" , None ),
219221 "extra" : {
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ repo_type = github
5454# source file. This is typically in the form of 'blob/<branch name>/<docs source folder>'.
5555edit_uri =
5656
57+ # Relative or absolute location of the PDF
58+ pdf_url =
59+
5760# Sitemap generation
5861# Specify a base_url used to generate sitemap.xml links. If not specified, then
5962# no sitemap will be built.
Original file line number Diff line number Diff line change 134134 </ div >
135135 {% endif %}
136136
137+ <!-- Link to PDF -->
138+ {% if config.pdf_url %}
139+ < div class ="md-header__button ">
140+ < a
141+ href ="{{ config.pdf_url }} "
142+ title ="PDF - {{ config.pdf_url }} "
143+ >
144+ < div class ="md-icon ">
145+ {% set icon = config.theme.icon.pdf or "fontawesome/solid/file-pdf" %}
146+ {% include ".icons/" ~ icon ~ ".svg" %}
147+ </ div >
148+ </ a >
149+ </ div >
150+ {% endif %}
151+
137152 <!-- Button to open search modal -->
138153 {% if "search" in config.plugins %}
139154 < label class ="md-header__button md-icon " for ="__search ">
You can’t perform that action at this time.
0 commit comments