Skip to content

Commit 13e1a5d

Browse files
Merge pull request #141 from Trivadis/bugfix/issue-140-missing-version
Bugfix/issue 140 missing version
2 parents 1fe5bc7 + 89c8e99 commit 13e1a5d

File tree

2 files changed

+162
-0
lines changed

2 files changed

+162
-0
lines changed

custom-theme/partials/header.html

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
<!--
2+
Copyright (c) 2016-2022 Martin Donath <martin.donath@squidfunk.com>
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to
6+
deal in the Software without restriction, including without limitation the
7+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8+
sell copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in
12+
all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20+
IN THE SOFTWARE.
21+
-->
22+
23+
<!-- Determine class according to configuration -->
24+
{% set class = "md-header" %}
25+
{% if "navigation.tabs.sticky" in features %}
26+
{% set class = class ~ " md-header--lifted" %}
27+
{% endif %}
28+
29+
<!-- Header -->
30+
<header class="{{ class }}" data-md-component="header">
31+
<nav
32+
class="md-header__inner md-grid"
33+
aria-label="{{ lang.t('header.title') }}"
34+
>
35+
36+
<!-- Link to home -->
37+
<a
38+
href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}"
39+
title="{{ config.site_name | e }}"
40+
class="md-header__button md-logo"
41+
aria-label="{{ config.site_name }}"
42+
data-md-component="logo"
43+
>
44+
{% include "partials/logo.html" %}
45+
</a>
46+
47+
<!-- Button to open drawer -->
48+
<label class="md-header__button md-icon" for="__drawer">
49+
{% include ".icons/material/menu" ~ ".svg" %}
50+
</label>
51+
52+
<!-- Header title -->
53+
<div class="md-header__title" data-md-component="header-title">
54+
<div class="md-header__ellipsis">
55+
<div class="md-header__topic">
56+
<span class="md-ellipsis">
57+
{{ config.site_name }} Version {{ config.extra.guideline_version }}
58+
</span>
59+
</div>
60+
<div class="md-header__topic" data-md-component="header-topic">
61+
<span class="md-ellipsis">
62+
{% if page.meta and page.meta.title %}
63+
{{ page.meta.title }}
64+
{% else %}
65+
{{ page.title }}
66+
{% endif %}
67+
</span>
68+
</div>
69+
</div>
70+
</div>
71+
72+
<!-- Color palette -->
73+
{% if not config.theme.palette is mapping %}
74+
<form class="md-header__option" data-md-component="palette">
75+
{% for option in config.theme.palette %}
76+
{% set primary = option.primary | replace(" ", "-") | lower %}
77+
{% set accent = option.accent | replace(" ", "-") | lower %}
78+
<input
79+
class="md-option"
80+
data-md-color-media="{{ option.media }}"
81+
data-md-color-scheme="{{ option.scheme }}"
82+
data-md-color-primary="{{ primary }}"
83+
data-md-color-accent="{{ accent }}"
84+
{% if option.toggle %}
85+
aria-label="{{ option.toggle.name }}"
86+
{% else %}
87+
aria-hidden="true"
88+
{% endif %}
89+
type="radio"
90+
name="__palette"
91+
id="__palette_{{ loop.index }}"
92+
/>
93+
{% if option.toggle %}
94+
<label
95+
class="md-header__button md-icon"
96+
title="{{ option.toggle.name }}"
97+
for="__palette_{{ loop.index0 or loop.length }}"
98+
hidden
99+
>
100+
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
101+
</label>
102+
{% endif %}
103+
{% endfor %}
104+
</form>
105+
{% endif %}
106+
107+
<!-- Site language selector -->
108+
{% if config.extra.alternate %}
109+
<div class="md-header__option"></form>
110+
<div class="md-select">
111+
{% set icon = config.theme.icon.alternate or "material/translate" %}
112+
<button
113+
class="md-header__button md-icon"
114+
aria-label="{{ lang.t('select.language.title') }}"
115+
>
116+
{% include ".icons/" ~ icon ~ ".svg" %}
117+
</button>
118+
<div class="md-select__inner">
119+
<ul class="md-select__list">
120+
{% for alt in config.extra.alternate %}
121+
<li class="md-select__item">
122+
<a
123+
href="{{ alt.link | url }}"
124+
hreflang="{{ alt.lang }}"
125+
class="md-select__link"
126+
>
127+
{{ alt.name }}
128+
</a>
129+
</li>
130+
{% endfor %}
131+
</ul>
132+
</div>
133+
</div>
134+
</div>
135+
{% endif %}
136+
137+
<!-- Button to open search modal -->
138+
{% if "search" in config["plugins"] %}
139+
<label class="md-header__button md-icon" for="__search">
140+
{% include ".icons/material/magnify.svg" %}
141+
</label>
142+
143+
<!-- Search interface -->
144+
{% include "partials/search.html" %}
145+
{% endif %}
146+
147+
<!-- Repository information -->
148+
{% if config.repo_url %}
149+
<div class="md-header__source">
150+
{% include "partials/source.html" %}
151+
</div>
152+
{% endif %}
153+
</nav>
154+
155+
<!-- Navigation tabs (sticky) -->
156+
{% if "navigation.tabs.sticky" in features %}
157+
{% if "navigation.tabs" in features %}
158+
{% include "partials/tabs.html" %}
159+
{% endif %}
160+
{% endif %}
161+
</header>

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ theme:
1010
icon:
1111
repo: fontawesome/brands/github-alt
1212
name: 'material'
13+
custom_dir: custom-theme
1314
favicon: images/favicon.ico
1415
palette:
1516
primary: 'white'

0 commit comments

Comments
 (0)