|
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 --> |
4 | 24 | {% set class = "md-header" %}
|
5 | 25 | {% if "navigation.tabs.sticky" in features %}
|
6 | 26 | {% set class = class ~ " md-header--shadow md-header--lifted" %}
|
7 | 27 | {% elif "navigation.tabs" not in features %}
|
8 | 28 | {% set class = class ~ " md-header--shadow" %}
|
9 | 29 | {% endif %}
|
| 30 | + |
| 31 | +<!-- Header --> |
10 | 32 | <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 --> |
13 | 39 | <a href="/" title="OpenObserve Homepage" class="md-header__button md-logo" aria-label="OpenObserve Homepage" data-md-component="logo">
|
14 | 40 | {% include "partials/logo.html" %}
|
15 | 41 | </a>
|
|
18 | 44 | <a href="/docs" title="Docs Home" class="md-header__button" style="font-weight: bold; font-size: 1rem; padding-left: 0.5rem;">
|
19 | 45 | <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>
|
20 | 46 | </a>
|
| 47 | + |
| 48 | + <!-- Button to open drawer --> |
21 | 49 | <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" %} |
24 | 51 | </label>
|
| 52 | + |
| 53 | + <!-- Header title --> |
25 | 54 | <div class="md-header__title" data-md-component="header-title">
|
26 | 55 | <div class="md-header__ellipsis">
|
27 | 56 | <div class="md-header__topic">
|
|
40 | 69 | </div>
|
41 | 70 | </div>
|
42 | 71 | </div>
|
| 72 | + |
| 73 | + <!-- Color palette --> |
43 | 74 | {% if config.theme.palette %}
|
44 | 75 | {% 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> |
46 | 108 | {% endif %}
|
47 | 109 | {% endif %}
|
48 |
| - {% if not config.theme.palette is mapping %} |
49 |
| - {% include "partials/javascripts/palette.html" %} |
50 |
| - {% endif %} |
| 110 | + |
| 111 | + <!-- Site language selector --> |
51 | 112 | {% 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> |
53 | 139 | {% endif %}
|
| 140 | + |
| 141 | + <!-- Button to open search modal --> |
54 | 142 | {% 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" %} |
63 | 149 | {% endif %}
|
| 150 | + |
| 151 | + <!-- Repository information --> |
64 | 152 | {% if config.repo_url %}
|
65 | 153 | <div class="md-header__source">
|
66 | 154 | {% include "partials/source.html" %}
|
67 | 155 | </div>
|
68 | 156 | {% endif %}
|
69 | 157 | </nav>
|
| 158 | + |
| 159 | + <!-- Navigation tabs (sticky) --> |
70 | 160 | {% if "navigation.tabs.sticky" in features %}
|
71 | 161 | {% if "navigation.tabs" in features %}
|
72 | 162 | {% include "partials/tabs.html" %}
|
|
0 commit comments