-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathreadthedocs-insert.html.tmpl
35 lines (27 loc) · 1.14 KB
/
readthedocs-insert.html.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!-- RTD Extra Head -->
{%- if canonical_url %}
{%- if pagename == "index" %}
{%- set canonical_page = "" %}
{%- elif pagename.endswith("/index") %}
{%- set canonical_page = pagename[:-("/index"|length)] + "/" %}
{%- else %}
{%- set ending = "/" if 'dirhtml' in builder else ".html" %}
{%- set canonical_page = pagename + ending %}
{%- endif %}
<!--
Always link to the latest version, as canonical.
http://docs.readthedocs.org/en/latest/canonical.html
-->
<link rel="canonical" href="{{ canonical_url|e }}{{ canonical_page }}" />
{%- endif %}
<link rel="stylesheet" href="{{ rtd_css_url }}" type="text/css" />
<script type="application/json" id="READTHEDOCS_DATA">{{ rtd_data | tojson }}</script>
<!--
Using this variable directly instead of using `JSON.parse` is deprecated.
The READTHEDOCS_DATA global variable will be removed in the future.
-->
<script type="text/javascript">
READTHEDOCS_DATA = JSON.parse(document.getElementById('READTHEDOCS_DATA').innerHTML);
</script>
<script type="text/javascript" src="{{ rtd_analytics_url }}" async="async"></script>
<!-- end RTD <extrahead> -->