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.
This commit is contained in:
+37
-214
@@ -1,218 +1,33 @@
|
||||
<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">
|
||||
<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">>_</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 menu--desktop">
|
||||
<li th:each="menuItem : ${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="@{${menuItem.status.href}}"
|
||||
th:href="@{${menuHref}}"
|
||||
th:target="${menuItem.spec.target?.value}"
|
||||
th:text="${menuItem.status.displayName}"></a>
|
||||
</div>
|
||||
@@ -220,13 +35,21 @@
|
||||
<div th:if="${not #lists.isEmpty(menuItem.children)}" class="menu">
|
||||
<div class="menu-wrapper">
|
||||
<a data-pjax
|
||||
th:href="@{${menuItem.status.href}}"
|
||||
th:href="@{${menuHref}}"
|
||||
th:target="${menuItem.spec.target?.value}">
|
||||
<span th:text="${menuItem.status.displayName}"></span>
|
||||
</a>
|
||||
<span class="menu-trigger">▾</span>
|
||||
<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">
|
||||
<ul class="menu-dropdown" th:id="|navigation-submenu-${menuStat.index}|">
|
||||
<li th:each="childMenuItem : ${menuItem.children}">
|
||||
<a data-pjax
|
||||
th:href="@{${childMenuItem.status.href}}"
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
<div class="homepage" th:fragment="home" th:attr="data-intro-style=${theme.config.index_page?.intro_style ?: 'detailed'}"
|
||||
th:with="home=${theme.config.index_page},
|
||||
profileEnabled=${home?.profile_enable != false},
|
||||
hasWelcome=${not #strings.isEmpty(home.notice_title) or not #strings.isEmpty(home.notice_content)},
|
||||
hasProfileText=${not #strings.isEmpty(home?.profile_name) or not #strings.isEmpty(home?.profile_role) or not #strings.isEmpty(home?.profile_bio) or not #strings.isEmpty(home?.profile_url)},
|
||||
hasProfile=${hasProfileText or not #strings.isEmpty(home?.profile_photo)},
|
||||
noteLimit=${home?.note_limit ?: 6},
|
||||
lifeLimit=${home?.life_limit ?: 6},
|
||||
bookLimit=${home?.book_limit ?: 4},
|
||||
projectLimit=${home?.project_limit ?: 4},
|
||||
articleSource=${home?.article_source ?: 'all'},
|
||||
dateFormat=${theme.config.general.time_style == 'custom' ? theme.config.general.custom_time_style : theme.config.general.time_style},
|
||||
categories=${categoryFinder.listAll()},
|
||||
lifeMatches=${categories.?[spec.displayName == '生活' or spec.slug == 'life']},
|
||||
lifeCategoryName=${not #strings.isEmpty(home?.life_category) ? home.life_category : (not #lists.isEmpty(lifeMatches) ? lifeMatches[0].metadata.name : null)},
|
||||
noteCategoryName=${articleSource == 'category' ? home?.note_category : null},
|
||||
lifeCategory=${#strings.isEmpty(lifeCategoryName) ? null : categoryFinder.getByName(lifeCategoryName)},
|
||||
noteCategory=${#strings.isEmpty(noteCategoryName) ? null : categoryFinder.getByName(noteCategoryName)},
|
||||
lifeCategoryNames=${lifeCategory == null ? {} : categories.?[metadata.name == #vars.lifeCategory.metadata.name or #lists.contains(#vars.categoryFinder.getBreadcrumbs(metadata.name).![metadata.name], #vars.lifeCategory.metadata.name)].![metadata.name]},
|
||||
noteCategoryNames=${lifeCategory == null or noteCategory == null ? {} : categories.?[metadata.name == #vars.noteCategory.metadata.name or #lists.contains(#vars.categoryFinder.getBreadcrumbs(metadata.name).![metadata.name], #vars.noteCategory.metadata.name)].![metadata.name]},
|
||||
sourcePosts=${lifeCategory == null ? (noteCategory != null ? postFinder.list({page: 1, size: noteLimit, categoryName: noteCategory.metadata.name}) : postFinder.list({page: 1, size: noteLimit})).items : postFinder.listAll()},
|
||||
notes=${lifeCategory == null ? sourcePosts : sourcePosts.?[
|
||||
status.hideFromList != true
|
||||
and (#vars.noteCategory == null or (not #lists.isEmpty(spec.categories) and not #lists.isEmpty(spec.categories.?[#lists.contains(#vars.noteCategoryNames, #this)])))
|
||||
and (#lists.isEmpty(spec.categories) or #lists.isEmpty(spec.categories.?[#lists.contains(#vars.lifeCategoryNames, #this)]))
|
||||
]},
|
||||
books=${home?.books},
|
||||
manualProjects=${home?.projects},
|
||||
usePortfolioPlugin=${home?.project_source != 'manual' and pluginFinder.available('portfolio')}">
|
||||
<div class="home-intro" th:if="${hasWelcome or (profileEnabled and hasProfile)}"
|
||||
th:attr="data-split=${profileEnabled ? (home?.profile_split ?: 'aligned') : 'single'}">
|
||||
<aside class="home-profile" th:if="${profileEnabled and hasProfile}" th:attr="aria-label=#{home.profile.title}">
|
||||
<div class="home-profile-copy" th:if="${hasProfileText}">
|
||||
<h2 class="home-profile-name" th:if="${not #strings.isEmpty(home?.profile_name)}" th:text="${home.profile_name}"></h2>
|
||||
<p class="home-profile-role" th:if="${not #strings.isEmpty(home?.profile_role)}" th:text="${home.profile_role}"></p>
|
||||
<p class="home-profile-bio" th:if="${not #strings.isEmpty(home?.profile_bio)}" th:text="${home.profile_bio}"></p>
|
||||
<a class="home-profile-link" th:if="${not #strings.isEmpty(home?.profile_url)}"
|
||||
th:href="${home.profile_url}" th:text="#{home.profile.more}">About me</a>
|
||||
</div>
|
||||
<img class="home-profile-photo" th:if="${not #strings.isEmpty(home?.profile_photo)}"
|
||||
th:src="${home.profile_photo}"
|
||||
th:alt="${not #strings.isEmpty(home?.profile_name) ? home.profile_name : #messages.msg('home.profile.photo')}"
|
||||
width="112" height="140" decoding="async"/>
|
||||
</aside>
|
||||
<section class="index-content home-welcome" th:if="${hasWelcome}">
|
||||
<svg class="home-welcome-art" viewBox="0 0 360 160" fill="none" aria-hidden="true" focusable="false"
|
||||
th:if="${home?.intro_style != 'plain'}">
|
||||
<g stroke="currentColor" stroke-width="1">
|
||||
<path d="M16 124h92l36-36h104l48-48h48M64 148h78l32-32h90l48-48h32M112 28h58l32 32h80l26-26h36"/>
|
||||
<path d="M208 4v24l28 28M280 160v-24l40-40h24"/>
|
||||
<circle cx="16" cy="124" r="3"/><circle cx="64" cy="148" r="3"/>
|
||||
<circle cx="112" cy="28" r="3"/><circle cx="208" cy="4" r="3"/>
|
||||
<circle cx="344" cy="40" r="3"/><circle cx="344" cy="68" r="3"/>
|
||||
<circle cx="344" cy="34" r="3"/><circle cx="344" cy="96" r="3"/>
|
||||
</g>
|
||||
</svg>
|
||||
<h1 class="typed-text" th:if="${not #strings.isEmpty(home.notice_title)}" th:text="${home.notice_title}">Hello Terminal!</h1>
|
||||
<div class="home-welcome-description" th:if="${not #strings.isEmpty(home.notice_content)}"
|
||||
th:utext="${home.notice_content}"></div>
|
||||
<div class="home-welcome-footer" th:if="${home.show_sns or home?.intro_style != 'plain'}">
|
||||
<div id="sns" class="home-social" th:if="${home.show_sns}">
|
||||
<th:block th:replace="~{modules/sns :: sns}"/>
|
||||
</div>
|
||||
<nav class="home-welcome-links" th:if="${home?.intro_style != 'plain'}" th:attr="aria-label=#{home.welcome.links}">
|
||||
<a data-pjax href="/archives"><span th:text="#{home.welcome.articles}">Article archive</span><svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M3 8h10M9 4l4 4-4 4"/></svg></a>
|
||||
<a data-pjax th:href="${#strings.isEmpty(home?.projects_more_url) ? '/portfolio' : home.projects_more_url}"><span th:text="#{home.projects.title}">Portfolio</span><svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M3 8h10M9 4l4 4-4 4"/></svg></a>
|
||||
</nav>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section id="sns" class="home-social" th:if="${home.show_sns and not hasWelcome}">
|
||||
<th:block th:replace="~{modules/sns :: sns}"/>
|
||||
</section>
|
||||
|
||||
<div class="home-row home-row--top">
|
||||
<section class="home-section home-notes" aria-labelledby="home-notes-title">
|
||||
<header class="home-section-heading">
|
||||
<h2 id="home-notes-title" th:text="#{home.notes.title}">Articles</h2>
|
||||
<a data-pjax class="home-more"
|
||||
th:href="${noteCategory != null ? noteCategory.status.permalink : '/archives'}"
|
||||
th:text="#{home.notes.more}">More</a>
|
||||
</header>
|
||||
<div class="posts home-note-list" th:if="${not #lists.isEmpty(notes)}"
|
||||
th:attr="data-columns=${home?.article_columns ?: 'auto'}">
|
||||
<th:block th:each="post, postStat : ${notes}">
|
||||
<th:block th:if="${postStat.index < noteLimit}">
|
||||
<th:block th:replace="~{modules/home :: note(post=${post})}"/>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
<p class="home-empty" th:if="${#lists.isEmpty(notes)}" th:text="#{home.notes.empty}">No articles yet.</p>
|
||||
</section>
|
||||
|
||||
<section class="home-section home-life" aria-labelledby="home-life-title">
|
||||
<header class="home-section-heading">
|
||||
<h2 id="home-life-title" th:text="#{home.life.title}">Life</h2>
|
||||
<a data-pjax class="home-more"
|
||||
th:href="${lifeCategory != null ? lifeCategory.status.permalink : '/categories'}" th:text="#{home.life.more}">More</a>
|
||||
</header>
|
||||
<div class="home-life-list">
|
||||
<th:block th:if="${lifeCategory != null}"
|
||||
th:with="lifePosts=${postFinder.list({page: 1, size: lifeLimit, categoryName: lifeCategory.metadata.name, sort: {'spec.publishTime,desc'}})}">
|
||||
<article class="home-life-post" th:each="post : ${lifePosts.items}">
|
||||
<a class="home-life-cover" data-pjax th:if="${not #strings.isEmpty(post.spec.cover)}"
|
||||
th:href="${post.status.permalink}" th:attr="aria-label=${post.spec.title}">
|
||||
<img th:src="${post.spec.cover}" alt="" width="96" height="96" loading="lazy" decoding="async"/>
|
||||
</a>
|
||||
<div class="home-life-copy">
|
||||
<h3><a data-pjax th:href="${post.status.permalink}" th:text="${post.spec.title}" th:title="${post.spec.title}">Post title</a></h3>
|
||||
<time class="post-title-time" th:if="${post.spec.publishTime != null}"
|
||||
th:datetime="${post.spec.publishTime}" th:text="${#dates.format(post.spec.publishTime, dateFormat)}"></time>
|
||||
<p class="home-summary" th:if="${not #strings.isEmpty(post.status.excerpt)}"
|
||||
th:text="${post.status.excerpt}"></p>
|
||||
</div>
|
||||
</article>
|
||||
<p class="home-empty" th:if="${#lists.isEmpty(lifePosts.items)}" th:text="#{home.life.empty}">Life, to be continued.</p>
|
||||
</th:block>
|
||||
<p class="home-empty" th:if="${lifeCategory == null}" th:text="#{home.life.empty}">Life, to be continued.</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="home-row home-row--bottom">
|
||||
<section class="home-section home-reading" aria-labelledby="home-reading-title">
|
||||
<header class="home-section-heading">
|
||||
<h2 id="home-reading-title" th:text="#{home.reading.title}">Reading</h2>
|
||||
<a data-pjax class="home-more"
|
||||
th:href="${#strings.isEmpty(home?.books_more_url) ? '/read' : home.books_more_url}" th:text="#{home.reading.more}">More</a>
|
||||
</header>
|
||||
<div class="home-book-grid" th:if="${not #lists.isEmpty(books)}">
|
||||
<article class="home-book" th:each="book, bookStat : ${books}" th:if="${bookStat.index < bookLimit}">
|
||||
<a class="home-book-cover" data-pjax th:href="${#strings.isEmpty(book.url) ? null : book.url}"
|
||||
th:attr="aria-label=${book.title}">
|
||||
<img th:if="${not #strings.isEmpty(book.cover)}" th:src="${book.cover}" th:alt="${book.title}"
|
||||
width="240" height="360" loading="lazy"/>
|
||||
<span class="home-book-placeholder" th:if="${#strings.isEmpty(book.cover)}" th:text="${book.title}"></span>
|
||||
</a>
|
||||
<h3 class="home-book-title" th:text="${book.title}">Book title</h3>
|
||||
<p class="home-book-comment" th:if="${not #strings.isEmpty(book.comment)}"
|
||||
th:text="${book.comment}" th:title="${book.comment}"></p>
|
||||
</article>
|
||||
</div>
|
||||
<p class="home-empty" th:if="${#lists.isEmpty(books)}" th:text="#{home.reading.empty}">A place for books and thoughts.</p>
|
||||
</section>
|
||||
|
||||
<section class="home-section home-projects" aria-labelledby="home-projects-title">
|
||||
<header class="home-section-heading">
|
||||
<h2 id="home-projects-title" th:text="#{home.projects.title}">Portfolio</h2>
|
||||
<a data-pjax class="home-more"
|
||||
th:href="${#strings.isEmpty(home?.projects_more_url) ? '/portfolio' : home.projects_more_url}"
|
||||
th:text="#{home.projects.more}">More</a>
|
||||
</header>
|
||||
<!-- Keep plugin Finder calls inside the availability guard. -->
|
||||
<th:block th:if="${usePortfolioPlugin}" th:with="projectResult=${projectFinder.list(1, projectLimit)}">
|
||||
<div class="home-project-grid" th:if="${not #lists.isEmpty(projectResult.items)}">
|
||||
<th:block th:each="project : ${projectResult.items}">
|
||||
<th:block th:replace="~{modules/home :: project(title=${project.title}, cover=${project.cover}, summary=${project.summary}, url=@{/portfolio/{slug}(slug=${project.slug})}, repoUrl=${project.repoUrl})}"/>
|
||||
</th:block>
|
||||
</div>
|
||||
<p class="home-empty" th:if="${#lists.isEmpty(projectResult.items)}" th:text="#{home.projects.empty}">Projects in progress.</p>
|
||||
</th:block>
|
||||
<th:block th:unless="${usePortfolioPlugin}">
|
||||
<div class="home-project-grid" th:if="${not #lists.isEmpty(manualProjects)}">
|
||||
<th:block th:each="project, projectStat : ${manualProjects}">
|
||||
<th:block th:if="${projectStat.index < projectLimit}">
|
||||
<th:block th:replace="~{modules/home :: project(title=${project.title}, cover=${project.cover}, summary=${project.summary}, url=${project.url}, repoUrl=${project.repoUrl})}"/>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
<p class="home-empty" th:if="${#lists.isEmpty(manualProjects)}" th:text="#{home.projects.empty}">Projects in progress.</p>
|
||||
</th:block>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<article class="home-note-post home-article-card" th:fragment="note(post)">
|
||||
<a class="home-article-link" data-pjax th:href="${post.status.permalink}" th:title="${post.spec.title}"
|
||||
th:attr="aria-labelledby=|home-article-title-${post.metadata.name}|">
|
||||
<div class="home-article-cover">
|
||||
<img th:if="${not #strings.isEmpty(post.spec.cover)}" th:src="${post.spec.cover}" th:alt="${post.spec.title}"
|
||||
th:srcset="|${thumbnail.gen(post.spec.cover, 's')} 400w, ${thumbnail.gen(post.spec.cover, 'm')} 800w, ${thumbnail.gen(post.spec.cover, 'l')} 1200w|"
|
||||
sizes="(max-width: 480px) 100vw, (max-width: 899px) 50vw, 33vw"
|
||||
width="480" height="480" loading="lazy"/>
|
||||
<span class="home-article-placeholder" th:if="${#strings.isEmpty(post.spec.cover)}" aria-hidden="true">>_</span>
|
||||
<span class="home-article-pin" th:if="${post.spec.pinned and home?.show_pin}" th:text="#{home.notes.pinned}">Pinned</span>
|
||||
</div>
|
||||
<div class="home-article-content">
|
||||
<h3 class="home-article-title" th:id="|home-article-title-${post.metadata.name}|" th:text="${post.spec.title}">Post title</h3>
|
||||
<p class="home-article-excerpt" th:text="${post.status.excerpt}"></p>
|
||||
<time class="home-article-date" th:if="${post.spec.publishTime != null}" th:datetime="${post.spec.publishTime}"
|
||||
th:text="${#dates.format(post.spec.publishTime, dateFormat)}"></time>
|
||||
<div class="home-article-tags" th:if="${home.show_tags}">
|
||||
<span th:each="tag : ${post.tags}" th:text="|#${tag.spec.displayName}|" th:title="${tag.spec.displayName}"></span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</article>
|
||||
|
||||
<article class="home-project" th:fragment="project(title, cover, summary, url, repoUrl)">
|
||||
<a class="home-project-cover" data-pjax th:if="${not #strings.isEmpty(cover)}"
|
||||
th:href="${#strings.isEmpty(url) ? null : url}" th:attr="aria-label=${title}">
|
||||
<img th:src="${cover}" th:alt="${title}" width="640" height="360" loading="lazy"/>
|
||||
</a>
|
||||
<h3 class="post-title home-project-title">
|
||||
<a data-pjax th:href="${#strings.isEmpty(url) ? null : url}" th:text="${title}">Project title</a>
|
||||
</h3>
|
||||
<p class="home-summary" th:if="${not #strings.isEmpty(summary)}" th:text="${summary}"></p>
|
||||
<a class="home-repository" th:if="${not #strings.isEmpty(repoUrl)}" th:href="${repoUrl}"
|
||||
target="_blank" rel="noopener noreferrer">
|
||||
<svg th:if="${#strings.contains(repoUrl, 'github.com/')}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
||||
<path d="M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2.3c-3.3.7-4-1.4-4-1.4-.5-1.4-1.3-1.7-1.3-1.7-1.1-.8.1-.8.1-.8 1.2.1 1.8 1.2 1.8 1.2 1.1 1.8 2.8 1.3 3.5 1 .1-.8.4-1.3.8-1.6-2.7-.3-5.5-1.3-5.5-5.9 0-1.3.5-2.4 1.2-3.2-.1-.3-.5-1.6.1-3.2 0 0 1-.3 3.3 1.2a11.5 11.5 0 0 1 6 0c2.3-1.5 3.3-1.2 3.3-1.2.6 1.6.2 2.9.1 3.2.8.8 1.2 1.9 1.2 3.2 0 4.6-2.8 5.6-5.5 5.9.5.4.8 1.1.8 2.2v3.3c0 .3.2.7.8.6A12 12 0 0 0 12 .3Z"/>
|
||||
</svg>
|
||||
<span th:text="${#strings.contains(repoUrl, 'github.com/') ? 'GitHub' : #messages.msg('page.portfolio.repository')}">GitHub</span>
|
||||
</a>
|
||||
</article>
|
||||
Reference in New Issue
Block a user