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 30
30
"search" : {},
31
31
},
32
32
"icon" : {},
33
+ "pdf_url" : "" ,
33
34
"repo_url" : "" ,
34
35
"edit_uri" : "" ,
35
36
"globaltoc_collapse" : True ,
@@ -214,6 +215,7 @@ def html_page_context(
214
215
"theme" : theme_options ,
215
216
"site_url" : theme_options .get ("site_url" ),
216
217
"site_name" : context ["docstitle" ],
218
+ "pdf_url" : theme_options .get ("pdf_url" ),
217
219
"repo_url" : theme_options .get ("repo_url" ),
218
220
"repo_name" : theme_options .get ("repo_name" , None ),
219
221
"extra" : {
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ repo_type = github
54
54
# source file. This is typically in the form of 'blob/<branch name>/<docs source folder>'.
55
55
edit_uri =
56
56
57
+ # Relative or absolute location of the PDF
58
+ pdf_url =
59
+
57
60
# Sitemap generation
58
61
# Specify a base_url used to generate sitemap.xml links. If not specified, then
59
62
# no sitemap will be built.
Original file line number Diff line number Diff line change 134
134
</ div >
135
135
{% endif %}
136
136
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
+
137
152
<!-- Button to open search modal -->
138
153
{% if "search" in config.plugins %}
139
154
< label class ="md-header__button md-icon " for ="__search ">
You can’t perform that action at this time.
0 commit comments