comparison doc/_templates/layout.html @ 7751:bd013590d8d6

docs: optimize head section of templates Reordered the head section of website/www using capo.js to improve speed. Tried to do the same for the doc/_template/layout.html. Due to a bug in sphinx, we get duplicate viewport tags. https://github.com/sphinx-doc/sphinx/issues/11699 but I think it's harmless.
author John Rouillard <rouilj@ieee.org>
date Fri, 01 Mar 2024 14:07:28 -0500
parents 291afa77ad82
children 7ac637506acf
comparison
equal deleted inserted replaced
7750:216662fbaaee 7751:bd013590d8d6
103 103
104 <html lang="en"> 104 <html lang="en">
105 <head> 105 <head>
106 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 106 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
107 <meta name="viewport" content="width=device-width, initial-scale=1"> 107 <meta name="viewport" content="width=device-width, initial-scale=1">
108 {%- if 'name="description"' not in metatags %}
109 <meta name="description"
110 content="Page {{ pagename }} in documentation on the Roundup issue tracker, version {{ release|e }}.">
111 {%- endif %}
112 {{ metatags }}
113 {%- if builder != 'htmlhelp' %} 108 {%- if builder != 'htmlhelp' %}
114 {%- set titlesuffix = " &mdash; "|safe + docstitle|e %} 109 {%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
115 {%- endif %} 110 {%- endif %}
116 <title>{{ title|striptags }}{{ titlesuffix }}</title> 111 <title>{{ title|striptags }}{{ titlesuffix }}</title>
117 {%- if builder == 'web' %}
118 <link rel="stylesheet" href="{{ pathto('index') }}?do=stylesheet{%
119 if in_admin_panel %}&admin=yes{% endif %}" type="text/css" />
120 {%- for link, type, title in page_links %}
121 <link rel="alternate" type="{{ type|e(true) }}" title="{{ title|e(true) }}" href="{{ link|e(true) }}" />
122 {%- endfor %}
123 {%- else %}
124 {{ css() }}
125 {%- endif %}
126 {%- if builder != 'htmlhelp' %} 112 {%- if builder != 'htmlhelp' %}
127 <script type="text/javascript"> 113 <script type="text/javascript">
128 var DOCUMENTATION_OPTIONS = { 114 var DOCUMENTATION_OPTIONS = {
129 URL_ROOT: '{{ pathto("", 1) }}', 115 URL_ROOT: '{{ pathto("", 1) }}',
130 VERSION: '{{ release|e }}', 116 VERSION: '{{ release|e }}',
133 }; 119 };
134 </script> 120 </script>
135 {%- for scriptfile in script_files %} 121 {%- for scriptfile in script_files %}
136 <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> 122 <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
137 {%- endfor %} 123 {%- endfor %}
124 {%- if builder == 'web' %}
125 <link rel="stylesheet" href="{{ pathto('index') }}?do=stylesheet{%
126 if in_admin_panel %}&admin=yes{% endif %}" type="text/css" />
127 {%- for link, type, title in page_links %}
128 <link rel="alternate" type="{{ type|e(true) }}" title="{{ title|e(true) }}" href="{{ link|e(true) }}" />
129 {%- endfor %}
130 {%- else %}
131 {{ css() }}
132 {%- endif %}
133 <!-- https://github.com/sphinx-doc/sphinx/issues/11699 means a
134 duplicate viewport tag -->
135 {{ metatags }}
136 {%- if 'name="description"' not in metatags %}
137 <meta name="description"
138 content="Page {{ pagename }} in documentation on the Roundup issue tracker, version {{ release|e }}.">
139 {%- endif %}
138 {%- if use_opensearch %} 140 {%- if use_opensearch %}
139 <link rel="search" type="application/opensearchdescription+xml" 141 <link rel="search" type="application/opensearchdescription+xml"
140 title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" 142 title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
141 href="{{ pathto('_static/opensearch.xml', 1) }}"/> 143 href="{{ pathto('_static/opensearch.xml', 1) }}"/>
142 {%- endif %} 144 {%- endif %}

Roundup Issue Tracker: http://roundup-tracker.org/