Files
halo_theme_terminal/templates/modules/header.html
T

243 lines
18 KiB
HTML

<th:block th:fragment="header" th:with="menu = ${menuFinder.getPrimary()}">
<div class="header-inner">
<div class="header-logo">
<a data-pjax th:href="@{/}">
<div class="logo"
th:text="${#strings.isEmpty(theme.config.header.logo) ? site.title : theme.config.header.logo}">
Blog Title
</div>
</a>
</div>
<button
th:each="button, buttonStat : ${theme.config.header.buttons}"
th:id="|search-button-${buttonStat.index}|"
class="header-action-button search-button"
th:with="buttonOptions=${button.options},
regularIcon=${buttonOptions?.iconify?.value},
pixelIcon=${buttonOptions?.pixel_iconify?.value}"
th:attr="aria-label=#{header.search.open}"
th:style="|order: ${buttonStat.index}|"
type="button"
data-header-action="open-search"
th:if="${button.value == 'search' and pluginFinder.available('PluginSearchWidget')}">
<span class="icon-regular button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(regularIcon) ? regularIcon : pixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path
fill="currentColor"
d="m19.6 21l-6.3-6.3q-.75.6-1.725.95T9.5 16q-2.725 0-4.612-1.888T3 9.5q0-2.725 1.888-4.612T9.5 3q2.725 0 4.612 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l6.3 6.3l-1.4 1.4ZM9.5 14q1.875 0 3.188-1.313T14 9.5q0-1.875-1.313-3.188T9.5 5Q7.625 5 6.312 6.313T5 9.5q0 1.875 1.313 3.188T9.5 14Z"
/>
</svg>
</span>
<span class="icon-pixel button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(pixelIcon) ? pixelIcon : regularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor"
d="M6 2h8v2H6zM4 6V4h2v2zm0 8H2V6h2zm2 2H4v-2h2zm8 0v2H6v-2zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2zm0-8h2v8h-2zm0 0V4h-2v2z"/>
</svg>
</span>
</button>
<div
th:each="button, buttonStat : ${theme.config.header.buttons}"
th:id="|color-scheme-picker-${buttonStat.index}|"
class="color-scheme-picker"
th:with="buttonOptions=${button.options},
regularIcon=${buttonOptions?.iconify?.value},
pixelIcon=${buttonOptions?.pixel_iconify?.value}"
th:style="|order: ${buttonStat.index}|"
th:if="${button.value == 'color_scheme'}">
<button
class="color-scheme-trigger"
type="button"
th:attr="aria-label=#{header.color_scheme.open},
aria-controls=|color-scheme-menu-${buttonStat.index}|"
aria-haspopup="listbox"
aria-expanded="false">
<span class="icon-regular button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(regularIcon) ? regularIcon : pixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor" d="M12.6 3.6c-5.96 0-10.8 4.3-10.8 9.6c0 3.97 3.23 7.2 7.2 7.2h1.98c.98 0 1.62-1 1.25-1.91c-.5-1.22.4-2.59 1.73-2.59h2.24c3.31 0 6-2.69 6-6c0-3.48-4.3-6.3-9.6-6.3ZM6 14.4a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Zm3.6-4.8a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Zm6 0a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Zm3.6 4.8a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Z"></path>
</svg>
</span>
<span class="icon-pixel button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(pixelIcon) ? pixelIcon : regularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor" d="M22.29 6.285h1.14V12h-1.14ZM21.143 12h1.147v2.287h-1.147Zm0-8.002h1.147v2.287h-1.147Zm-1.14 10.29h1.14v1.14h-1.14Zm0-11.43h1.14v1.14h-1.14Zm-1.148 12.57h1.148v1.147h-1.148Zm0-6.855h1.148v4.567h-1.148Zm-1.14 8.002h1.14v1.14h-1.14Zm0-3.435h1.14v1.148h-1.14Zm0-11.422h2.287v1.14h-2.287Zm-1.14 15.997h1.14v1.14h-1.14Zm0-3.427h1.14v1.14h-1.14Zm-1.147-6.855h3.427v1.14h-3.427Zm0 11.422h1.147v1.148h-1.147Zm-1.14 1.148h1.14v1.14h-1.14ZM12 15.428h4.575v1.147H12Zm2.288-6.855h1.14v1.14h-1.14Zm0-2.288h2.287v-1.14h1.14V3.998h-1.14v-1.14h-2.287v1.14h-1.14v1.147h1.14zm-1.14 14.858h1.14v1.14h-1.14Zm0-11.431h1.14v1.148h-1.14ZM12 10.86h1.148V12H12ZM6.285 22.283h6.863v1.147H6.285ZM10.86 12H12v3.428h-1.14ZM9.712.57h8.003v1.148H9.712Zm1.148 16.005H8.573v1.14h-1.14v2.288h1.14v1.14h2.287v-1.14H12v-2.288h-1.14zM7.433 1.718h2.28v1.14h-2.28Zm0 7.994h2.28v-1.14h1.147V6.285H9.713v-1.14h-2.28v1.14H6.284v2.287h1.147zm-3.428 5.716h2.28v-1.14h1.148V12H6.285v-1.14h-2.28V12H2.858v2.287h1.147zm1.14-12.57h2.288v1.14H5.145Zm0 18.285h1.14v1.14h-1.14Zm-2.287-1.14h2.287v1.14H2.858ZM4.005 3.998h1.14v1.147h-1.14ZM2.858 5.145h1.147v2.288H2.858Zm-1.14 12.57h1.14v2.287h-1.14Zm0-10.282h1.14v2.28h-1.14ZM.57 9.712h1.148v8.003H.57Z"/>
</svg>
</span>
</button>
<div
th:id="|color-scheme-menu-${buttonStat.index}|"
class="color-scheme-menu"
role="listbox"
th:attr="aria-label=#{header.color_scheme.list}"
hidden>
<button
class="color-scheme-option"
type="button"
role="option"
aria-selected="true"
data-color-scheme="default">
default
</button>
</div>
</div>
<button
th:each="button, buttonStat : ${theme.config.header.buttons}"
th:id="|appearance-toggle-${buttonStat.index}|"
class="header-action-button appearance-toggle"
th:with="buttonOptions=${button.options},
lightRegularIcon=${buttonOptions?.light_iconify?.value},
lightPixelIcon=${buttonOptions?.light_pixel_iconify?.value},
darkRegularIcon=${buttonOptions?.dark_iconify?.value},
darkPixelIcon=${buttonOptions?.dark_pixel_iconify?.value},
systemRegularIcon=${buttonOptions?.system_iconify?.value},
systemPixelIcon=${buttonOptions?.system_pixel_iconify?.value}"
th:attr="aria-label=#{header.appearance.current}"
th:style="|order: ${buttonStat.index}|"
th:if="${button.value == 'appearance'}"
type="button">
<span class="appearance-icon icon-regular button-icon" data-appearance-mode="light" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(lightRegularIcon) or not #strings.isEmpty(lightPixelIcon)}"
th:utext="${not #strings.isEmpty(lightRegularIcon) ? lightRegularIcon : lightPixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(lightRegularIcon) or not #strings.isEmpty(lightPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4V2m0 18v2M6.414 6.414L5 5m12.728 12.728l1.414 1.414M4 12H2m18 0h2m-4.271-5.586L19.143 5M6.415 17.728L5 19.142M12 17a5 5 0 1 1 0-10a5 5 0 0 1 0 10"></path>
</svg>
</span>
<span class="appearance-icon icon-pixel button-icon" data-appearance-mode="light" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(lightRegularIcon) or not #strings.isEmpty(lightPixelIcon)}"
th:utext="${not #strings.isEmpty(lightPixelIcon) ? lightPixelIcon : lightRegularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(lightRegularIcon) or not #strings.isEmpty(lightPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M13 22h-2v-3h2v3Zm-6-3H5v-2h2v2Zm12 0h-2v-2h2v2Zm-4-2H9v-2h6v2Zm-6-2H7V9h2v6Zm8 0h-2V9h2v6ZM5 13H2v-2h3v2Zm17 0h-3v-2h3v2Zm-7-4H9V7h6v2ZM7 7H5V5h2v2Zm12 0h-2V5h2v2Zm-6-2h-2V2h2v3Z"/>
</svg>
</span>
<span class="appearance-icon icon-regular button-icon" data-appearance-mode="dark" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(darkRegularIcon) or not #strings.isEmpty(darkPixelIcon)}"
th:utext="${not #strings.isEmpty(darkRegularIcon) ? darkRegularIcon : darkPixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(darkRegularIcon) or not #strings.isEmpty(darkPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 6a9 9 0 0 0 9 9c.91 0 1.787-.134 2.614-.385A9 9 0 0 1 12 21A9 9 0 0 1 9.386 3.386A9 9 0 0 0 9 6"></path>
</svg>
</span>
<span class="appearance-icon icon-pixel button-icon" data-appearance-mode="dark" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(darkRegularIcon) or not #strings.isEmpty(darkPixelIcon)}"
th:utext="${not #strings.isEmpty(darkPixelIcon) ? darkPixelIcon : darkRegularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(darkRegularIcon) or not #strings.isEmpty(darkPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">
<path d="M18 22H8v-2h10v2ZM8 20H6v-2h2v2Zm12 0h-2v-2h2v2ZM6 18H4v-2h2v2Zm16 0h-2v-4h-2v-2h2v-2h2v8ZM4 16H2V6h2v10Zm14 0h-6v-2h6v2Zm-6-2h-2v-2h2v2Zm-2-2H8V6h2v6ZM6 6H4V4h2v2Zm8-2h-2v2h-2V4H6V2h8v2Z"/>
</svg>
</span>
<span class="appearance-icon icon-regular button-icon" data-appearance-mode="system" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(systemRegularIcon) or not #strings.isEmpty(systemPixelIcon)}"
th:utext="${not #strings.isEmpty(systemRegularIcon) ? systemRegularIcon : systemPixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(systemRegularIcon) or not #strings.isEmpty(systemPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="8" fill="none" stroke="currentColor" stroke-width="2"/>
</svg>
</span>
<span class="appearance-icon icon-pixel button-icon" data-appearance-mode="system" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(systemRegularIcon) or not #strings.isEmpty(systemPixelIcon)}"
th:utext="${not #strings.isEmpty(systemPixelIcon) ? systemPixelIcon : systemRegularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(systemRegularIcon) or not #strings.isEmpty(systemPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M18 4h-6v3H9v2H7v6h2v2h3v3h6v2H6v-2H4v-2H2V6h2V4h2V2h12v2Zm2 16h-2v-2h2v2Zm2-2h-2V6h2v12Zm-7-9h2v6h-2v2h-3V7h3v2Zm5-3h-2V4h2v2Z"></path>
</svg>
</span>
</button>
<button
th:each="button, buttonStat : ${theme.config.header.buttons}"
th:id="|pixel-toggle-${buttonStat.index}|"
class="header-action-button pixel-toggle"
th:with="buttonOptions=${button.options},
regularIcon=${buttonOptions?.iconify?.value},
pixelIcon=${buttonOptions?.pixel_iconify?.value}"
th:attr="aria-label=#{header.pixel_style.toggle}"
th:style="|order: ${buttonStat.index}|"
th:if="${button.value == 'pixel_style'}"
type="button">
<span class="icon-pixel button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(pixelIcon) ? pixelIcon : regularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">
<path d="M13.75 20.75h-3.5v-3.5h3.5v3.5Zm7 0h-3.5v-3.5h3.5v3.5Zm-7-7h-7v3.5h-3.5v-14h10.5v10.5Zm3.5 3.5h-3.5v-3.5h3.5v3.5Zm3.5-3.5h-3.5v-3.5h3.5v3.5Zm-14-3.5h3.5v-3.5h-3.5v3.5Z"/>
</svg>
</span>
<span class="icon-regular button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(regularIcon) ? regularIcon : pixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">
<path d="M13.75 20.75h-3.5v-3.5h3.5v3.5Zm7 0h-3.5v-3.5h3.5v3.5Zm-7-7h-7v3.5h-3.5v-14h10.5v10.5Zm3.5 3.5h-3.5v-3.5h3.5v3.5Zm3.5-3.5h-3.5v-3.5h3.5v3.5Zm-14-3.5h3.5v-3.5h-3.5v3.5Z"/>
</svg>
</span>
</button>
<th:block th:each="button, buttonStat : ${theme.config.header.buttons}">
<button
class="header-action-button custom-header-button"
type="button"
data-header-action="custom"
th:with="buttonOptions=${button.options},
regularIcon=${buttonOptions?.iconify?.value},
pixelIcon=${buttonOptions?.pixel_iconify?.value}"
th:if="${button.value == 'custom'
and button.options != null
and not #strings.isEmpty(button.options.name)
and (not #strings.isEmpty(button.options.iconify?.value)
or not #strings.isEmpty(button.options.pixel_iconify?.value))}"
th:style="|order: ${buttonStat.index}|"
th:attr="aria-label=${buttonOptions.name},
title=${buttonOptions.name},
data-onclick=${buttonOptions.onclick}">
<span class="icon-regular button-icon" aria-hidden="true"
th:utext="${not #strings.isEmpty(regularIcon) ? regularIcon : pixelIcon}"></span>
<span class="icon-pixel button-icon" aria-hidden="true"
th:utext="${not #strings.isEmpty(pixelIcon) ? pixelIcon : regularIcon}"></span>
</button>
</th:block>
</div>
<nav class="navigation-menu">
<ul th:if="${menu != null} and ${not #lists.isEmpty(menu.menuItems)}"
class="navigation-menu-inner menu--desktop">
<li th:each="menuItem : ${menu.menuItems}">
<div th:if="${#lists.isEmpty(menuItem.children)}">
<a data-pjax
th:href="@{${menuItem.status.href}}"
th:target="${menuItem.spec.target?.value}"
th:text="${menuItem.status.displayName}"></a>
</div>
<div th:if="${not #lists.isEmpty(menuItem.children)}" class="menu">
<a data-pjax
th:href="@{${menuItem.status.href}}"
th:target="${menuItem.spec.target?.value}">
<span th:text="${menuItem.status.displayName}"></span>
</a>
<div class="sub-menu">
<div class="menu-trigger">▾</div>
<ul class="menu-dropdown">
<li th:each="childMenuItem : ${menuItem.children}">
<a data-pjax
th:href="@{${childMenuItem.status.href}}"
th:target="${childMenuItem.spec.target?.value}">
<span th:text="${childMenuItem.status.displayName}"></span>
</a>
</li>
</ul>
</div>
</div>
</li>
</ul>
</nav>
</th:block>