Files
witcher ca00daddf6 feat: release Terminal-Witcher 3.1.17 and project handoff
Ship responsive navigation, configurable profile and four-section homepage, article/life category separation, natural-ratio book covers, and independent border settings. Include release history and complete context handoff documentation.
2026-11-16 18:30:36 +08:00

66 lines
3.8 KiB
HTML

<th:block th:fragment="header" th:with="menu = ${menuFinder.getPrimary()}">
<a class="header-brand" data-pjax th:href="@{/}"
th:attr="aria-label=|${site.title} - #{page.error.back}|">
<img class="header-brand-logo" th:if="${not #strings.isEmpty(site.logo)}"
th:src="${site.logo}" alt="" width="36" height="36"/>
<span class="header-brand-fallback" th:if="${#strings.isEmpty(site.logo)}" aria-hidden="true">&gt;_</span>
<span class="header-brand-title" th:text="${site.title}" th:title="${site.title}">Blog Title</span>
</a>
<button class="navigation-toggle" type="button" aria-controls="site-navigation" aria-expanded="false"
th:if="${menu != null and not #lists.isEmpty(menu.menuItems)}"
th:attr="aria-label=#{header.navigation.open},
data-label-open=#{header.navigation.open},
data-label-close=#{header.navigation.close}">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</button>
<nav id="site-navigation" class="navigation-menu" th:attr="aria-label=#{header.navigation.label}">
<ul th:if="${menu != null} and ${not #lists.isEmpty(menu.menuItems)}"
class="navigation-menu-inner">
<li th:each="menuItem, menuStat : ${menu.menuItems}"
th:with="menuHref=${menuItem.status.displayName == '文章' ? '/archives' : menuItem.status.href}"
th:if="${menuItem.status.displayName != '首页'
and not #strings.equalsIgnoreCase(menuItem.status.displayName, 'home')
and menuItem.status.href != '/'
and menuItem.status.href != site.url
and menuItem.status.href != site.url + '/'}">
<div th:if="${#lists.isEmpty(menuItem.children)}">
<a data-pjax
th:href="@{${menuHref}}"
th:target="${menuItem.spec.target?.value}"
th:text="${menuItem.status.displayName}"></a>
</div>
<div th:if="${not #lists.isEmpty(menuItem.children)}" class="menu">
<div class="menu-wrapper">
<a data-pjax
th:href="@{${menuHref}}"
th:target="${menuItem.spec.target?.value}">
<span th:text="${menuItem.status.displayName}"></span>
</a>
<button class="menu-trigger" type="button" aria-expanded="false"
th:attr="aria-label=|#{header.navigation.submenu} ${menuItem.status.displayName}|,
aria-controls=|navigation-submenu-${menuStat.index}|">
<svg class="menu-chevron" viewBox="0 0 12 12" fill="none"
aria-hidden="true" focusable="false">
<path d="m3 4.5 3 3 3-3" stroke="currentColor" stroke-width="1.5"
stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
<ul class="menu-dropdown" th:id="|navigation-submenu-${menuStat.index}|">
<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>
</li>
</ul>
</nav>
</th:block>