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