|
| 1 | +<!-- |
| 2 | + Copyright (c) 2016-2024 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 classes --> |
| 24 | +{% set class = "md-header" %} |
| 25 | +{% if "navigation.tabs.sticky" in features %} |
| 26 | + {% set class = class ~ " md-header--shadow md-header--lifted" %} |
| 27 | +{% elif "navigation.tabs" not in features %} |
| 28 | + {% set class = class ~ " md-header--shadow" %} |
| 29 | +{% endif %} |
| 30 | + |
| 31 | +<!-- Header --> |
| 32 | +<header class="{{ class }}" data-md-component="header"> |
| 33 | + <nav |
| 34 | + class="md-header__inner md-grid" |
| 35 | + aria-label="{{ lang.t('header') }}" |
| 36 | + > |
| 37 | + |
| 38 | + <!-- Link to home --> |
| 39 | + <!-- <a |
| 40 | + href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}" |
| 41 | + title="{{ config.site_name | e }}" |
| 42 | + class="md-header__button md-logo" |
| 43 | + aria-label="{{ config.site_name }}" |
| 44 | + data-md-component="logo" |
| 45 | + > |
| 46 | + {% include "partials/logo.html" %} |
| 47 | + </a> --> |
| 48 | + <a |
| 49 | + href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}" |
| 50 | + title="www.sparkfun.com/pnt" |
| 51 | + class="md-header__button md-logo" |
| 52 | + aria-label="{{ config.site_name }}" |
| 53 | + data-md-component="logo" |
| 54 | + > |
| 55 | + {% include "partials/logo.html" %} |
| 56 | + </a> |
| 57 | + |
| 58 | + <!-- Button to open drawer --> |
| 59 | + <label class="md-header__button md-icon" for="__drawer"> |
| 60 | + {% set icon = config.theme.icon.menu or "material/menu" %} |
| 61 | + {% include ".icons/" ~ icon ~ ".svg" %} |
| 62 | + </label> |
| 63 | + |
| 64 | + <!-- Header title --> |
| 65 | + <div class="md-header__title" data-md-component="header-title"> |
| 66 | + <div class="md-header__ellipsis"> |
| 67 | + <div class="md-header__topic"> |
| 68 | + <span class="md-ellipsis"> |
| 69 | + {{ config.site_name }} |
| 70 | + </span> |
| 71 | + </div> |
| 72 | + <div class="md-header__topic" data-md-component="header-topic"> |
| 73 | + <span class="md-ellipsis"> |
| 74 | + {% if page.meta and page.meta.title %} |
| 75 | + {{ page.meta.title }} |
| 76 | + {% else %} |
| 77 | + {{ page.title }} |
| 78 | + {% endif %} |
| 79 | + </span> |
| 80 | + </div> |
| 81 | + </div> |
| 82 | + </div> |
| 83 | + |
| 84 | + |
| 85 | + <!-- Color palette --> |
| 86 | + {% if not config.theme.palette is mapping %} |
| 87 | + <form class="md-header__option" data-md-component="palette"> |
| 88 | + {% for option in config.theme.palette %} |
| 89 | + {% set scheme = option.scheme | d("default", true) %} |
| 90 | + <input |
| 91 | + class="md-option" |
| 92 | + data-md-color-media="{{ option.media }}" |
| 93 | + data-md-color-scheme="{{ scheme | replace(' ', '-') }}" |
| 94 | + data-md-color-primary="{{ option.primary | replace(' ', '-') }}" |
| 95 | + data-md-color-accent="{{ option.accent | replace(' ', '-') }}" |
| 96 | + {% if option.toggle %} |
| 97 | + aria-label="{{ option.toggle.name }}" |
| 98 | + {% else %} |
| 99 | + aria-hidden="true" |
| 100 | + {% endif %} |
| 101 | + type="radio" |
| 102 | + name="__palette" |
| 103 | + id="__palette_{{ loop.index }}" |
| 104 | + /> |
| 105 | + {% if option.toggle %} |
| 106 | + <label |
| 107 | + class="md-header__button md-icon" |
| 108 | + title="{{ option.toggle.name }}" |
| 109 | + for="__palette_{{ loop.index0 or loop.length }}" |
| 110 | + hidden |
| 111 | + > |
| 112 | + {% include ".icons/" ~ option.toggle.icon ~ ".svg" %} |
| 113 | + </label> |
| 114 | + {% endif %} |
| 115 | + {% endfor %} |
| 116 | + </form> |
| 117 | + {% endif %} |
| 118 | + |
| 119 | + <!-- Button for Cookie Consent --> |
| 120 | + <label class="md-header__button md-icon"> |
| 121 | + <a href="#__consent" title="Manage Cookies"> |
| 122 | + {% include ".icons/material/cookie-edit.svg" %} |
| 123 | + </a> |
| 124 | + </label> |
| 125 | + |
| 126 | + |
| 127 | + <!-- Site language selector --> |
| 128 | + {% if config.extra.alternate %} |
| 129 | + {% include "partials/alternate.html" %} |
| 130 | + {% endif %} |
| 131 | + |
| 132 | + <!-- Button to open search modal --> |
| 133 | + {% if "material/search" in config.plugins %} |
| 134 | + <label class="md-header__button md-icon" for="__search"> |
| 135 | + {% set icon = config.theme.icon.search or "material/magnify" %} |
| 136 | + {% include ".icons/" ~ icon ~ ".svg" %} |
| 137 | + </label> |
| 138 | + |
| 139 | + <!-- Search interface --> |
| 140 | + {% include "partials/search.html" %} |
| 141 | + {% endif %} |
| 142 | + |
| 143 | + <!-- Repository information --> |
| 144 | + {% if config.repo_url %} |
| 145 | + <div class="md-header__source"> |
| 146 | + {% include "partials/source.html" %} |
| 147 | + </div> |
| 148 | + {% endif %} |
| 149 | + </nav> |
| 150 | + |
| 151 | + <!-- Navigation tabs (sticky) --> |
| 152 | + {% if "navigation.tabs.sticky" in features %} |
| 153 | + {% if "navigation.tabs" in features %} |
| 154 | + {% include "partials/tabs.html" %} |
| 155 | + {% endif %} |
| 156 | + {% endif %} |
| 157 | +</header> |
0 commit comments