]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/templates/page.html
Rollup merge of #106453 - coastalwhite:master, r=GuillaumeGomez
[rust.git] / src / librustdoc / html / templates / page.html
1 <!DOCTYPE html> {#- -#}
2 <html lang="en"> {#- -#}
3 <head> {#- -#}
4     <meta charset="utf-8"> {#- -#}
5     <meta name="viewport" content="width=device-width, initial-scale=1.0"> {#- -#}
6     <meta name="generator" content="rustdoc"> {#- -#}
7     <meta name="description" content="{{page.description}}"> {#- -#}
8     <meta name="keywords" content="{{page.keywords}}"> {#- -#}
9     <title>{{page.title}}</title> {#- -#}
10     <link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.source_serif_4_regular}}"> {#- -#}
11     <link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.fira_sans_regular}}"> {#- -#}
12     <link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.fira_sans_medium}}"> {#- -#}
13     <link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.source_code_pro_regular}}"> {#- -#}
14     <link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.source_serif_4_bold}}"> {#- -#}
15     <link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.source_code_pro_semibold}}"> {#- -#}
16     <link rel="stylesheet" {# -#}
17           href="{{static_root_path|safe}}{{files.normalize_css}}"> {#- -#}
18     <link rel="stylesheet" {# -#}
19           href="{{static_root_path|safe}}{{files.rustdoc_css}}" {# -#}
20           id="mainThemeStyle"> {#- -#}
21     <link rel="stylesheet" id="themeStyle" href="{{static_root_path|safe}}{{files.theme_light_css}}"> {#- -#}
22     <link rel="stylesheet" disabled href="{{static_root_path|safe}}{{files.theme_dark_css}}"> {#- -#}
23     <link rel="stylesheet" disabled href="{{static_root_path|safe}}{{files.theme_ayu_css}}"> {#- -#}
24     {%- for theme in themes -%}
25         <link rel="stylesheet" disabled href="{{page.root_path|safe}}{{theme}}{{page.resource_suffix}}.css"> {#- -#}
26     {%- endfor -%}
27     <script id="default-settings" {# -#}
28       {% for (k, v) in layout.default_settings %}
29         data-{{k}}="{{v}}"
30       {%- endfor -%}
31     ></script> {#- -#}
32     <script src="{{static_root_path|safe}}{{files.storage_js}}"></script> {#- -#}
33     {%- if page.css_class.contains("crate") -%}
34     <script defer src="{{page.root_path|safe}}crates{{page.resource_suffix}}.js"></script> {#- -#}
35     {%- else if page.css_class == "source" -%}
36     <script defer src="{{static_root_path|safe}}{{files.source_script_js}}"></script> {#- -#}
37     <script defer src="{{page.root_path|safe}}source-files{{page.resource_suffix}}.js"></script> {#- -#}
38     {%- else if !page.css_class.contains("mod") -%}
39     <script defer src="sidebar-items{{page.resource_suffix}}.js"></script> {#- -#}
40     {%- endif -%}
41     <script defer src="{{static_root_path|safe}}{{files.main_js}}"></script> {#- -#}
42     {%- if layout.scrape_examples_extension -%}
43     <script defer src="{{static_root_path|safe}}{{files.scrape_examples_js}}"></script> {#- -#}
44     {%- endif -%}
45     <noscript> {#- -#}
46         <link rel="stylesheet" {# -#}
47            href="{{static_root_path|safe}}{{files.noscript_css}}"> {#- -#}
48     </noscript> {#- -#}
49     {%- if layout.css_file_extension.is_some() -%}
50         <link rel="stylesheet" {# -#}
51             href="{{static_root_path|safe}}theme{{page.resource_suffix}}.css"> {#- -#}
52     {%- endif -%}
53     {%- if !layout.favicon.is_empty() -%}
54         <link rel="icon" href="{{layout.favicon}}"> {#- -#}
55     {%- else -%}
56         <link rel="alternate icon" type="image/png" {# -#}
57             href="{{static_root_path|safe}}{{files.rust_favicon_png_16}}"> {#- -#}
58         <link rel="alternate icon" type="image/png" {# -#}
59             href="{{static_root_path|safe}}{{files.rust_favicon_png_32}}"> {#- -#}
60         <link rel="icon" type="image/svg+xml" {# -#}
61             href="{{static_root_path|safe}}{{files.rust_favicon_svg}}"> {#- -#}
62     {%- endif -%}
63     {{- layout.external_html.in_header|safe -}}
64 </head> {#- -#}
65 <body class="rustdoc {{page.css_class}}"> {#- -#}
66     <!--[if lte IE 11]> {#- -#}
67     <div class="warning"> {#- -#}
68         This old browser is unsupported and will most likely display funky things. {#- -#}
69     </div> {#- -#}
70     <![endif]--> {#- -#}
71     {{- layout.external_html.before_content|safe -}}
72     {%- if page.css_class != "source" -%}
73     <nav class="mobile-topbar"> {#- -#}
74         <button class="sidebar-menu-toggle">&#9776;</button> {#- -#}
75         <a class="logo-container" href="{{page.root_path|safe}}{{krate_with_trailing_slash|safe}}index.html"> {#- -#}
76         {%- if !layout.logo.is_empty() -%}
77             <img src="{{layout.logo}}" alt="logo"> {#- -#}
78         {%- else -%}
79             <img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt="logo"> {#- -#}
80         {%- endif -%}
81         </a> {#- -#}
82         <h2></h2> {#- -#}
83     </nav> {#- -#}
84     {%- endif -%}
85     <nav class="sidebar"> {#- -#}
86         {%- if page.css_class != "source" -%}
87         <a class="logo-container" href="{{page.root_path|safe}}{{krate_with_trailing_slash|safe}}index.html"> {#- -#}
88             {%- if !layout.logo.is_empty()  %}
89                 <img src="{{layout.logo}}" alt="logo"> {#- -#}
90             {%- else -%}
91                 <img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt="logo"> {#- -#}
92             {%- endif -%}
93         </a> {#- -#}
94         {%- endif -%}
95         {{- sidebar|safe -}}
96     </nav> {#- -#}
97     <main> {#- -#}
98         {%- if page.css_class != "source" -%}<div class="width-limiter">{%- endif -%}
99             <nav class="sub"> {#- -#}
100                 {%- if page.css_class == "source" -%}
101                 <a class="sub-logo-container" href="{{page.root_path|safe}}{{krate_with_trailing_slash|safe}}index.html"> {#- -#}
102                     {%- if !layout.logo.is_empty()  %}
103                         <img src="{{layout.logo}}" alt="logo"> {#- -#}
104                     {%- else -%}
105                         <img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt="logo"> {#- -#}
106                     {%- endif -%}
107                 </a> {#- -#}
108                 {%- endif -%}
109                 <form class="search-form"> {#- -#}
110                     <span></span> {#- This empty span is a hacky fix for Safari - See #93184 -#}
111                     <input {# -#}
112                         class="search-input" {# -#}
113                         name="search" {# -#}
114                         aria-label="Run search in the documentation" {# -#}
115                         autocomplete="off" {# -#}
116                         spellcheck="false" {# -#}
117                         placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {# -#}
118                         type="search"> {#- -#}
119                     <div id="help-button" title="help" tabindex="-1"> {#- -#}
120                         <a href="{{page.root_path|safe}}help.html">?</a> {#- -#}
121                     </div> {#- -#}
122                     <div id="settings-menu" tabindex="-1"> {#- -#}
123                         <a href="{{page.root_path|safe}}settings.html" title="settings"> {#- -#}
124                             <img width="22" height="22" alt="Change settings" {# -#}
125                             src="{{static_root_path|safe}}{{files.wheel_svg}}"> {#- -#}
126                         </a> {#- -#}
127                     </div> {#- -#}
128                 </form> {#- -#}
129             </nav> {#- -#}
130             <section id="main-content" class="content">{{- content|safe -}}</section> {#- -#}
131         {%- if page.css_class != "source" -%}</div>{%- endif -%}
132     </main> {#- -#}
133     {{- layout.external_html.after_content|safe -}}
134     <div id="rustdoc-vars" {# -#}
135          data-root-path="{{page.root_path|safe}}" {# -#}
136          data-static-root-path="{{static_root_path|safe}}" {# -#}
137          data-current-crate="{{layout.krate}}" {# -#}
138          data-themes="{{themes|join(",") }}" {# -#}
139          data-resource-suffix="{{page.resource_suffix}}" {# -#}
140          data-rustdoc-version="{{rustdoc_version}}" {# -#}
141          data-search-js="{{files.search_js}}" {# -#}
142          data-settings-js="{{files.settings_js}}" {# -#}
143          data-settings-css="{{files.settings_css}}" {# -#}
144     > {#- -#}
145     </div> {#- -#}
146 </body> {#- -#}
147 </html> {#- -#}