Mercurial > p > roundup > code
comparison website/www/_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 |
|---|---|
| 5 <!DOCTYPE html> | 5 <!DOCTYPE html> |
| 6 <html lang="en"> | 6 <html lang="en"> |
| 7 <head> | 7 <head> |
| 8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | 8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 9 <meta name="viewport" content="width=device-width, initial-scale=1"> | 9 <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 10 {%- if 'name="description"' not in metatags %} | |
| 11 <meta name="description" | |
| 12 content="Page {{ pagename }} in documentation on the Roundup issue tracker, version {{ release|e }}."> | |
| 13 {%- endif %} | |
| 14 {{ metatags }} | |
| 15 {%- if builder != 'htmlhelp' %} | 10 {%- if builder != 'htmlhelp' %} |
| 16 {%- set titlesuffix = docstitle|e %} | 11 {%- set titlesuffix = docstitle|e %} |
| 17 {%- set titlesuffix = " - " + titlesuffix %} | 12 {%- set titlesuffix = " - " + titlesuffix %} |
| 18 {%- endif %} | 13 {%- endif %} |
| 19 <title>{{ title|striptags }}{{ titlesuffix }}</title> | 14 <title>{{ title|striptags }}{{ titlesuffix }}</title> |
| 20 {%- if builder == 'web' %} | 15 |
| 21 <link rel="stylesheet" href="{{ pathto('index') }}?do=stylesheet{% | |
| 22 if in_admin_panel %}&admin=yes{% endif %}" type="text/css" /> | |
| 23 {%- for link, type, title in page_links %} | |
| 24 <link rel="alternate" type="{{ type|e(true) }}" title="{{ title|e(true) }}" href="{{ link|e(true) }}" /> | |
| 25 {%- endfor %} | |
| 26 {%- else %} | |
| 27 <link rel="stylesheet" href="{{ pathto('_static/style.css', 1) }}" type="text/css" /> | |
| 28 {%- endif %} | |
| 29 {%- if builder != 'htmlhelp' %} | 16 {%- if builder != 'htmlhelp' %} |
| 30 <script type="text/javascript"> | 17 <script type="text/javascript"> |
| 31 var DOCUMENTATION_OPTIONS = { | 18 var DOCUMENTATION_OPTIONS = { |
| 32 URL_ROOT: '{{ pathto("", 1) }}', | 19 URL_ROOT: '{{ pathto("", 1) }}', |
| 33 VERSION: '{{ release|e }}', | 20 VERSION: '{{ release|e }}', |
| 38 {%- if pagename == 'search' %} | 25 {%- if pagename == 'search' %} |
| 39 {%- for scriptfile in script_files %} | 26 {%- for scriptfile in script_files %} |
| 40 <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> | 27 <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> |
| 41 {%- endfor %} | 28 {%- endfor %} |
| 42 <script type="text/javascript">$('#searchbox').show(0);</script> | 29 <script type="text/javascript">$('#searchbox').show(0);</script> |
| 30 {%- endif %} | |
| 31 | |
| 32 {%- if builder == 'web' %} | |
| 33 <link rel="stylesheet" href="{{ pathto('index') }}?do=stylesheet{% | |
| 34 if in_admin_panel %}&admin=yes{% endif %}" type="text/css" /> | |
| 35 {%- for link, type, title in page_links %} | |
| 36 <link rel="alternate" type="{{ type|e(true) }}" title="{{ title|e(true) }}" href="{{ link|e(true) }}" /> | |
| 37 {%- endfor %} | |
| 38 {%- else %} | |
| 39 <link rel="stylesheet" href="{{ pathto('_static/style.css', 1) }}" type="text/css" /> | |
| 40 {%- endif %} | |
| 41 <!-- https://github.com/sphinx-doc/sphinx/issues/11699 means a | |
| 42 duplicate viewport tag --> | |
| 43 {{ metatags }} | |
| 44 {%- if 'name="description"' not in metatags %} | |
| 45 <meta name="description" | |
| 46 content="Page {{ pagename }} in documentation on the Roundup issue tracker, version {{ release|e }}."> | |
| 43 {%- endif %} | 47 {%- endif %} |
| 44 {%- if pageurl %} | 48 {%- if pageurl %} |
| 45 <link rel="canonical" href="{{ pageurl|e }}" /> | 49 <link rel="canonical" href="{{ pageurl|e }}" /> |
| 46 {%- endif %} | 50 {%- endif %} |
| 47 {%- if use_opensearch %} | 51 {%- if use_opensearch %} |
