Skip to content

Commit c12d299

Browse files
msbtamotl
authored andcommitted
use proper base.html and clean up page.html
1 parent 5f777ab commit c12d299

2 files changed

Lines changed: 169 additions & 289 deletions

File tree

Lines changed: 148 additions & 220 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,63 @@
1-
{#
2-
basic/layout.html
3-
~~~~~~~~~~~~~~~~~
4-
5-
Master layout template for Sphinx themes.
6-
7-
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
8-
:license: BSD, see LICENSE for details.
9-
#}
10-
{%- block doctype -%}
11-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
12-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
13-
{%- endblock %}
14-
{%- set reldelim1 = reldelim1 is not defined and ' &raquo;' or reldelim1 %}
15-
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
16-
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
17-
(sidebars != []) %}
18-
{%- set url_root = pathto('', 1) %}
19-
{# XXX necessary? #}
20-
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
21-
{%- if not embedded and docstitle %}
22-
{%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
23-
{%- else %}
24-
{%- set titlesuffix = "" %}
25-
{%- endif %}
26-
27-
{%- macro relbar() %}
28-
<div class="related">
29-
<h3>{{ _('Navigation') }}</h3>
30-
<ul>
31-
{%- for rellink in rellinks %}
32-
<li class="right" {% if loop.first %} style="margin-right: 10px"{% endif %}>
33-
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
34-
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
35-
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
36-
{%- endfor %}
37-
{%- block rootrellink %}
38-
<li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
39-
{%- endblock %}
40-
{%- for parent in parents %}
41-
<li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
42-
{%- endfor %}
43-
{%- block relbaritems %} {% endblock %}
44-
</ul>
45-
</div>
46-
{%- endmacro %}
47-
48-
{%- macro sidebar() %}
49-
{%- if render_sidebar %}
50-
<div class="sphinxsidebar">
51-
<div class="sphinxsidebarwrapper">
52-
{%- block sidebarlogo %}
53-
{%- if logo %}
54-
<p class="logo"><a href="{{ pathto(master_doc) }}">
55-
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
56-
</a></p>
57-
{%- endif %}
58-
{%- endblock %}
59-
{%- if sidebars != None %}
60-
{#- new style sidebar: explicitly include/exclude templates #}
61-
{%- for sidebartemplate in sidebars %}
62-
{%- include sidebartemplate %}
63-
{%- endfor %}
64-
{%- else %}
65-
{#- old style sidebars: using blocks -- should be deprecated #}
66-
{%- block sidebartoc %}
67-
{%- include "localtoc.html" %}
68-
{%- endblock %}
69-
{%- block sidebarrel %}
70-
{%- include "relations.html" %}
71-
{%- endblock %}
72-
{%- block sidebarsourcelink %}
73-
{%- include "sourcelink.html" %}
74-
{%- endblock %}
75-
{%- if customsidebar %}
76-
{%- include customsidebar %}
77-
{%- endif %}
78-
{%- block sidebarsearch %}
79-
{%- include "searchbox.html" %}
80-
{%- endblock %}
81-
{%- endif %}
82-
</div>
83-
</div>
84-
{%- endif %}
85-
{%- endmacro %}
86-
87-
{%- macro script() %}
88-
1+
<!doctype html>
2+
<html class="no-js"{% if language is not none %} lang="{{ language }}"{% endif %} data-content_root="{{ content_root }}">
3+
<head>
4+
{%- block site_meta -%}
5+
<meta charset="utf-8"/>
6+
<meta name="viewport" content="width=device-width,initial-scale=1"/>
7+
<meta name="color-scheme" content="light dark">
8+
9+
{%- if metatags %}{{ metatags }}{% endif -%}
10+
11+
{%- block linktags %}
12+
{%- if hasdoc('about') -%}
13+
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
14+
{%- endif -%}
15+
{#%- if hasdoc('genindex') -%}
16+
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
17+
{%- endif -%#}
18+
{%- if hasdoc('search') -%}
19+
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
20+
{%- endif -%}
21+
{#%- if hasdoc('copyright') -%}
22+
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
23+
{%- endif -%#}
24+
{%- if next -%}
25+
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
26+
{%- endif -%}
27+
{%- if prev -%}
28+
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
29+
{%- endif -%}
30+
{#- rel="canonical" (set by html_baseurl) -#}
31+
{#%- if pageurl %}
32+
<link rel="canonical" href="{{ pageurl|e }}" />
33+
{%- endif %#}
34+
{%- endblock linktags %}
35+
36+
{# Favicon #}
37+
<link rel="shortcut icon" type="image/png" href="{{ pathto('_static', 1) }}/images/favicon.png"/>
38+
39+
{%- endblock site_meta -%}
40+
41+
{% block head_extra %}
8942
<!-- Algolia DNS Prefetch -->
9043
<link rel="preconnect" href="https://az1nev7cg0-dsn.algolia.net" crossorigin />
91-
92-
{{ js_tag("_static/bundle/main.js") }}
93-
94-
{%- for js in script_files %}
95-
{{ js_tag(js) }}
96-
{%- endfor %}
97-
98-
{%- for js in extra_script_files %}
99-
{{ js_tag(js) }}
100-
{%- endfor %}
101-
102-
{%- endmacro %}
103-
104-
{%- macro css() %}
105-
106-
{%- for css in css_files %}
107-
{%- if css|attr("filename") %}
108-
{{ css_tag(css) }}
109-
{%- else %}
110-
<link rel="stylesheet" href="{{ pathto(css, 1)|e }}" type="text/css" />
111-
{%- endif %}
112-
{%- endfor %}
113-
114-
{%- for css in extra_css_files %}
115-
{%- if css|attr("filename") %}
116-
{{ css_tag(css) }}
117-
{%- else %}
118-
<link rel="stylesheet" href="{{ pathto(css, 1)|e }}" type="text/css" />
119-
{%- endif %}
120-
{%- endfor %}
121-
122-
{%- endmacro %}
123-
124-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
125-
<head>
126-
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
127-
{{ metatags }}
128-
{%- block htmltitle %}
129-
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
130-
{%- endblock %}
131-
{{ css() }}
132-
{%- if not embedded %}
133-
{%- block scripts %}
134-
{{- script() }}
135-
{%- endblock %}
136-
{%- if use_opensearch %}
137-
<link rel="search" type="application/opensearchdescription+xml"
138-
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
139-
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
140-
{%- endif %}
141-
44+
<!-- Algolia stylesheet -->
45+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
46+
47+
<!-- Google Tag Manager -->
48+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
49+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
50+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
51+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
52+
})(window,document,'script','dataLayer','GTM-WHMDSK');</script>
53+
<!-- End Google Tag Manager -->
54+
55+
<noscript>
56+
<style>
57+
.cr-nojs-hide { display: none; }
58+
</style>
59+
</noscript>
60+
14261
{%- if custom_baseurl %}
14362
{%- set canonical_page = pagename + ".html" %}
14463
<!--
@@ -147,93 +66,102 @@ <h3>{{ _('Navigation') }}</h3>
14766
-->
14867
<link rel="canonical" href="{{ custom_baseurl|e }}{{ canonical_page }}" />
14968
{%- endif %}
69+
{% endblock %}
70+
71+
{#- Site title -#}
72+
{%- block htmltitle -%}
73+
{% if not docstitle %}
74+
<title>{{ title|striptags|e }}</title>
75+
{% elif pagename == master_doc %}
76+
<title>{{ docstitle|striptags|e }}</title>
77+
{% else %}
78+
<title>{{ title|striptags|e }} - {{ docstitle|striptags|e }}</title>
79+
{% endif %}
80+
{%- endblock -%}
81+
82+
{%- block styles -%}
83+
84+
{# Custom stylesheets #}
85+
{%- block regular_styles -%}
86+
{% if not omit_skeleton_css -%}
87+
<link rel="stylesheet" href="{{ pathto('_static/skeleton.css', 1) }}" type="text/css" />
88+
{%- endif -%}
89+
90+
{%- for css in css_files -%}
91+
{% if css|attr("filename") -%}
92+
{{ css_tag(css) }}
93+
{%- else -%}
94+
<link rel="stylesheet" href="{{ pathto(css, 1)|e }}" type="text/css" />
95+
{%- endif %}
96+
{% endfor -%}
97+
{%- endblock regular_styles -%}
15098

151-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
99+
{#- Theme-related stylesheets -#}
100+
{%- block theme_styles %}
101+
{% include "partials/_head_css_variables.html" with context %}
102+
{%- endblock -%}
152103

153-
<link rel="icon" type="image/png" href="{{ pathto('_static', 1) }}/images/favicon.png"/>
154-
{%- endif %}
155-
{%- block linktags %}
156-
{%- if hasdoc('about') %}
157-
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
158-
{%- endif %}
159-
{%- if hasdoc('genindex') %}
160-
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
161-
{%- endif %}
162-
{%- if hasdoc('search') %}
163-
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
164-
{%- endif %}
165-
{%- if hasdoc('copyright') %}
166-
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
167-
{%- endif %}
168-
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
169-
{%- if parents %}
170-
<link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" />
171-
{%- endif %}
172-
{%- if next %}
173-
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
174-
{%- endif %}
175-
{%- if prev %}
176-
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
177-
{%- endif %}
178-
{%- endblock %}
179-
{%- block extra_head %} {% endblock %}
104+
{%- block extra_styles %}
105+
{%- endblock -%}
106+
107+
{%- endblock styles -%}
108+
109+
<script src="{{ pathto('_static/bundle/main.js', 1) }}?ver={{ theme_ver }}"></script>
110+
{#- Custom front matter #}
111+
{%- block extrahead -%}{%- endblock -%}
180112
</head>
181-
{% if project == 'SQL 99' %}
182-
<body class="cr-docs-sql-99">
183-
{% else %}
184113
<body>
185-
{% endif %}
186-
<!-- Google Tag Manager (noscript) -->
187-
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WHMDSK"
188-
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
189-
<!-- End Google Tag Manager (noscript) -->
190-
191-
{%- block header %}{% endblock %}
192-
193-
{%- block relbar1 %}{{ relbar() }}{% endblock %}
194-
195-
{%- block content %}
196-
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
197-
198-
<div class="document">
199-
{%- block document %}
200-
<div class="documentwrapper">
201-
{%- if render_sidebar %}
202-
<div class="bodywrapper">
203-
{%- endif %}
204-
<div class="body" role="main">
205-
{% block body %} {% endblock %}
114+
{% block body %}
115+
<script>
116+
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
117+
</script>
118+
{% endblock %}
119+
120+
{%- block scripts -%}
121+
122+
{# Custom JS #}
123+
{%- block regular_scripts -%}
124+
{% for path in script_files -%}
125+
{{ js_tag(path) }}
126+
{% endfor -%}
127+
{%- endblock regular_scripts -%}
128+
129+
{# Theme-related JavaScript code #}
130+
{%- block theme_scripts -%}
131+
{%- endblock -%}
132+
133+
{%- endblock scripts -%}
134+
135+
{% block footer %}
136+
<footer class="sb-footer">
137+
<div class="footer-subscription cr-nojs-hide">
138+
<div class="content-wrapper container">
139+
<div class="row">
140+
<div class="col-md-3">
141+
<h4>Subscribe to the CrateDB Newsletter now</h4>
142+
</div>
143+
<div class="col-md-9">
144+
<div class="footer-subs-form">
145+
<!--[if lte IE 8]>
146+
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
147+
<![endif]-->
148+
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
149+
<script>
150+
hbspt.forms.create({
151+
region: "na1",
152+
portalId: "19927462",
153+
formId: "76d1441f-eef8-4e8e-950d-9b66bf24bd8e"
154+
});
155+
</script>
156+
</div>
157+
</div>
206158
</div>
207-
{%- if render_sidebar %}
208159
</div>
209-
{%- endif %}
210160
</div>
211-
{%- endblock %}
212-
213-
{%- block sidebar2 %}{{ sidebar() }}{% endblock %}
214-
<div class="clearer"></div>
215-
</div>
216-
{%- endblock %}
217-
218-
{%- block relbar2 %}{{ relbar() }}{% endblock %}
219-
220-
{%- block custom_footer %}
221-
<div class="footer">
222-
{%- if show_copyright %}
223-
{%- if hasdoc('copyright') %}
224-
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
225-
{%- else %}
226-
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
227-
{%- endif %}
228-
{%- endif %}
229-
{%- if last_updated %}
230-
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
231-
{%- endif %}
232-
{%- if show_sphinx %}
233-
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
234-
{%- endif %}
235-
</div>
236-
{%- endblock %}
237-
161+
<div class="sb-footer__inner sb-page-width">
162+
{% include "sections/footer.html" %}
163+
</div>
164+
</footer>
165+
{% endblock footer %}
238166
</body>
239167
</html>

0 commit comments

Comments
 (0)