|
| 1 | +<!-- Determine classes --> |
| 2 | +{% set class = "md-header" %} {% if "navigation.tabs.sticky" in features %} {% |
| 3 | +set class = class ~ " md-header--shadow md-header--lifted" %} {% elif |
| 4 | +"navigation.tabs" not in features %} {% set class = class ~ " md-header--shadow" |
| 5 | +%} {% endif %} |
| 6 | + |
| 7 | +<!-- Header --> |
| 8 | +<header class="{{ class }}" data-md-component="header"> |
| 9 | + <nav class="md-header__inner md-grid" aria-label="{{ lang.t('header') }}"> |
| 10 | + <!-- Link to home --> |
| 11 | + |
| 12 | + <!-- Button to open drawer --> |
| 13 | + <label class="md-header__button md-icon" for="__drawer"> |
| 14 | + {% set icon = config.theme.icon.menu or "material/menu" %} {% include |
| 15 | + ".icons/" ~ icon ~ ".svg" %} |
| 16 | + </label> |
| 17 | + |
| 18 | + <!-- Custom: Link to Practical.li --> |
| 19 | + <a |
| 20 | + href="{{ config.site_org | url }}" |
| 21 | + title="{{ config.site_org | e }}" |
| 22 | + class="md-header__button md-logo" |
| 23 | + aria-label="{{ config.site_org }}" |
| 24 | + data-md-component="logo" |
| 25 | + target="_blank" |
| 26 | + > |
| 27 | + {% include "partials/logo.html" %} |
| 28 | + </a> |
| 29 | + |
| 30 | + <!-- Header title --> |
| 31 | + <div class="md-header__title" data-md-component="header-title"> |
| 32 | + <div class="md-header__ellipsis"> |
| 33 | + <div class="md-header__topic"> |
| 34 | + <a |
| 35 | + href="{{ config.site_url | url }}" |
| 36 | + title="{{ config.site_name | e }}" |
| 37 | + aria-label="{{ config.site_name }}" |
| 38 | + > |
| 39 | + <span class="md-ellipsis"> {{ config.site_name }} </span> |
| 40 | + </a> |
| 41 | + </div> |
| 42 | + <div class="md-header__topic" data-md-component="header-topic"> |
| 43 | + <span class="md-ellipsis"> |
| 44 | + {% if page.meta and page.meta.title %} {{ page.meta.title }} {% else |
| 45 | + %} {{ page.title }} {% endif %} |
| 46 | + </span> |
| 47 | + </div> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | + |
| 51 | + <!-- Color palette toggle --> |
| 52 | + {% if config.theme.palette %} {% if not config.theme.palette is mapping %} |
| 53 | + {% include "partials/palette.html" %} {% endif %} {% endif %} |
| 54 | + |
| 55 | + <!-- Site language selector --> |
| 56 | + {% if config.extra.alternate %} {% include "partials/alternate.html" %} {% |
| 57 | + endif %} |
| 58 | + |
| 59 | + <!-- Button to open search modal --> |
| 60 | + {% if "material/search" in config.plugins %} |
| 61 | + <label class="md-header__button md-icon" for="__search"> |
| 62 | + {% set icon = config.theme.icon.search or "material/magnify" %} {% include |
| 63 | + ".icons/" ~ icon ~ ".svg" %} |
| 64 | + </label> |
| 65 | + |
| 66 | + <!-- Search interface --> |
| 67 | + {% include "partials/search.html" %} {% endif %} |
| 68 | + |
| 69 | + <!-- Repository information --> |
| 70 | + {% if config.repo_url %} |
| 71 | + <div class="md-header__source">{% include "partials/source.html" %}</div> |
| 72 | + {% endif %} |
| 73 | + </nav> |
| 74 | + |
| 75 | + <!-- Navigation tabs (sticky) --> |
| 76 | + {% if "navigation.tabs.sticky" in features %} {% if "navigation.tabs" in |
| 77 | + features %} {% include "partials/tabs.html" %} {% endif %} {% endif %} |
| 78 | +</header> |
0 commit comments