Skip to content

Commit 1e0d15a

Browse files
committed
Add sticky top bar title.
1 parent 038cba3 commit 1e0d15a

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

docs/_static/custom.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,15 @@ ul.search li p.context {
240240
padding: 0 0.7rem;
241241
}
242242

243+
/* header-article */
244+
div.header-article__label {
245+
display: flex;
246+
align-items: center;
247+
margin: 0 auto 0 1em;
248+
font-size: 80%;
249+
overflow: hidden;
250+
white-space: nowrap;
251+
}
243252

244253
/* submenu */
245254
.bd-toc {
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{# To trigger whether the TOC and its button show up #}
2+
{% set page_toc = generate_toc_html() %}
3+
{% from "../macros/buttons.html" import render_funcs, render_label_input_button with context %}
4+
5+
<div class="col py-1 d-flex header-article-main">
6+
<div class="header-article__left">
7+
{% if theme_single_page != True %}
8+
{{ render_label_input_button(for_input="__navigation", tooltip="Toggle navigation", icon="fas fa-bars", tooltip_placement="right") }}
9+
{% endif %}
10+
</div>
11+
<div class="header-article__label">
12+
<span>{{ title|striptags|e }}{%- for parent in parents[:1] %} – {{ parent.title }}{%- endfor %}</span>
13+
</div>
14+
<div class="header-article__right">
15+
{%- for button in header_buttons -%}
16+
{{ render_funcs[button.pop("type")](**button) }}
17+
{%- endfor -%}
18+
19+
{% if page_toc -%}
20+
{{ render_label_input_button("__page-toc", icon="fas fa-list", label="page-toc") }}
21+
{%- endif %}
22+
</div>
23+
</div>
24+
25+
<!-- Table of contents -->
26+
<div class="col-md-3 bd-toc show noprint">
27+
{%- if page_toc | length >= 1 %}
28+
<div class="tocsection onthispage pt-5 pb-3">
29+
<i class="fas fa-list"></i> {{ translate(theme_toc_title) }}
30+
</div>
31+
<nav id="bd-toc-nav" aria-label="Page">
32+
{{ page_toc }}
33+
</nav>
34+
{%- endif %}
35+
</div>

0 commit comments

Comments
 (0)