Skip to content

Commit 9a40d85

Browse files
authored
Update header.html
1 parent c43d454 commit 9a40d85

File tree

1 file changed

+110
-20
lines changed

1 file changed

+110
-20
lines changed

overrides/partials/header.html

Lines changed: 110 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,41 @@
1-
{#-
2-
This file was automatically generated - do not edit
3-
-#}
1+
<!--
2+
Copyright (c) 2016-2023 Martin Donath <[email protected]>
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 base classes -->
424
{% set class = "md-header" %}
525
{% if "navigation.tabs.sticky" in features %}
626
{% set class = class ~ " md-header--shadow md-header--lifted" %}
727
{% elif "navigation.tabs" not in features %}
828
{% set class = class ~ " md-header--shadow" %}
929
{% endif %}
30+
31+
<!-- Header -->
1032
<header class="{{ class }}" data-md-component="header">
11-
<nav class="md-header__inner md-grid" aria-label="{{ lang.t('header') }}">
12-
<!-- Logo linking to main site -->
33+
<nav
34+
class="md-header__inner md-grid"
35+
aria-label="{{ lang.t('header') }}"
36+
>
37+
38+
<!-- Logo linking to main site -->
1339
<a href="/" title="OpenObserve Homepage" class="md-header__button md-logo" aria-label="OpenObserve Homepage" data-md-component="logo">
1440
{% include "partials/logo.html" %}
1541
</a>
@@ -18,10 +44,13 @@
1844
<a href="/docs" title="Docs Home" class="md-header__button" style="font-weight: bold; font-size: 1rem; padding-left: 0.5rem;">
1945
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M320-440h320v-80H320v80Zm0 120h320v-80H320v80Zm0 120h200v-80H320v80ZM240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520v-200H240v640h480v-440H520ZM240-800v200-200 640-640Z"/></svg>
2046
</a>
47+
48+
<!-- Button to open drawer -->
2149
<label class="md-header__button md-icon" for="__drawer">
22-
{% set icon = config.theme.icon.menu or "material/menu" %}
23-
{% include ".icons/" ~ icon ~ ".svg" %}
50+
{% include ".icons/material/menu" ~ ".svg" %}
2451
</label>
52+
53+
<!-- Header title -->
2554
<div class="md-header__title" data-md-component="header-title">
2655
<div class="md-header__ellipsis">
2756
<div class="md-header__topic">
@@ -40,33 +69,94 @@
4069
</div>
4170
</div>
4271
</div>
72+
73+
<!-- Color palette -->
4374
{% if config.theme.palette %}
4475
{% if not config.theme.palette is mapping %}
45-
{% include "partials/palette.html" %}
76+
<form class="md-header__option" data-md-component="palette">
77+
{% for option in config.theme.palette %}
78+
{% set scheme = option.scheme | d("default", true) %}
79+
{% set primary = option.primary | d("indigo", true) %}
80+
{% set accent = option.accent | d("indigo", true) %}
81+
<input
82+
class="md-option"
83+
data-md-color-media="{{ option.media }}"
84+
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
85+
data-md-color-primary="{{ primary | replace(' ', '-') }}"
86+
data-md-color-accent="{{ accent | replace(' ', '-') }}"
87+
{% if option.toggle %}
88+
aria-label="{{ option.toggle.name }}"
89+
{% else %}
90+
aria-hidden="true"
91+
{% endif %}
92+
type="radio"
93+
name="__palette"
94+
id="__palette_{{ loop.index }}"
95+
/>
96+
{% if option.toggle %}
97+
<label
98+
class="md-header__button md-icon"
99+
title="{{ option.toggle.name }}"
100+
for="__palette_{{ loop.index0 or loop.length }}"
101+
hidden
102+
>
103+
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
104+
</label>
105+
{% endif %}
106+
{% endfor %}
107+
</form>
46108
{% endif %}
47109
{% endif %}
48-
{% if not config.theme.palette is mapping %}
49-
{% include "partials/javascripts/palette.html" %}
50-
{% endif %}
110+
111+
<!-- Site language selector -->
51112
{% if config.extra.alternate %}
52-
{% include "partials/alternate.html" %}
113+
<div class="md-header__option">
114+
<div class="md-select">
115+
{% set icon = config.theme.icon.alternate or "material/translate" %}
116+
<button
117+
class="md-header__button md-icon"
118+
aria-label="{{ lang.t('select.language') }}"
119+
>
120+
{% include ".icons/" ~ icon ~ ".svg" %}
121+
</button>
122+
<div class="md-select__inner">
123+
<ul class="md-select__list">
124+
{% for alt in config.extra.alternate %}
125+
<li class="md-select__item">
126+
<a
127+
href="{{ alt.link | url }}"
128+
hreflang="{{ alt.lang }}"
129+
class="md-select__link"
130+
>
131+
{{ alt.name }}
132+
</a>
133+
</li>
134+
{% endfor %}
135+
</ul>
136+
</div>
137+
</div>
138+
</div>
53139
{% endif %}
140+
141+
<!-- Button to open search modal -->
54142
{% if "material/search" in config.plugins %}
55-
{% set search = config.plugins["material/search"] | attr("config") %}
56-
{% if search.enabled %}
57-
<label class="md-header__button md-icon" for="__search">
58-
{% set icon = config.theme.icon.search or "material/magnify" %}
59-
{% include ".icons/" ~ icon ~ ".svg" %}
60-
</label>
61-
{% include "partials/search.html" %}
62-
{% endif %}
143+
<label class="md-header__button md-icon" for="__search">
144+
{% include ".icons/material/magnify.svg" %}
145+
</label>
146+
147+
<!-- Search interface -->
148+
{% include "partials/search.html" %}
63149
{% endif %}
150+
151+
<!-- Repository information -->
64152
{% if config.repo_url %}
65153
<div class="md-header__source">
66154
{% include "partials/source.html" %}
67155
</div>
68156
{% endif %}
69157
</nav>
158+
159+
<!-- Navigation tabs (sticky) -->
70160
{% if "navigation.tabs.sticky" in features %}
71161
{% if "navigation.tabs" in features %}
72162
{% include "partials/tabs.html" %}

0 commit comments

Comments
 (0)