Files
maoxiang d36050cff7 初始化仓库
初始化仓库
2026-09-09 13:19:09 +08:00

477 lines
21 KiB
HTML

<!doctype html>
<html
lang="zh-CN"
xmlns:th="https://www.thymeleaf.org"
th:lang="${#locale.toLanguageTag}"
class="color-scheme-auto"
data-color-scheme="auto"
>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title th:text="|${category.spec.displayName} - ${site.title}|">分类</title>
<script type="module" crossorigin src="/themes/theme-mdocs/assets/main-BAX9Eehy.js"></script>
<link rel="stylesheet" crossorigin href="/themes/theme-mdocs/assets/main-OuYKDL0n.css">
</head>
<body
th:style="'--radius:' + (${theme.config.global?.border_radius} ?: '12px') + ';--font-size:' + (${theme.config.global?.font_size} ?: '16px')"
th:attr="data-bg-light=${theme.config.global?.bg_color_light ?: '#ffffff'},data-bg-dark=${theme.config.global?.bg_color_dark ?: '#0d1117'},data-bg-image=${theme.config.global?.background_image},data-primary=${theme.config.global?.primary_color}"
th:with="siteLogo = ${not #strings.isEmpty(theme.config.global?.site_logo) ? theme.config.global?.site_logo : site.logo}, siteLogoDark = ${not #strings.isEmpty(theme.config.global?.site_logo_dark) ? theme.config.global?.site_logo_dark : siteLogo}, showSiteName = ${theme.config.global?.show_site_name != false}"
>
<header class="site-header">
<div
class="container header-inner"
th:with="primaryMenu = ${menuFinder.getPrimary()}"
>
<a class="site-brand" th:href="@{/}">
<img
th:if="${not #strings.isEmpty(siteLogo)}"
th:src="${siteLogo}"
th:attr="data-logo-light=${siteLogo},data-logo-dark=${siteLogoDark}"
class="brand-logo"
alt="logo"
/>
<span class="brand-name" th:if="${showSiteName}" th:text="${site.title}">源蝶工作室</span>
</a>
<nav class="primary-nav" th:if="${not #lists.isEmpty(theme.config.nav?.doc_nav_buttons)}">
<a
class="primary-nav-link"
th:each="btn : ${theme.config.nav?.doc_nav_buttons ?: T(java.util.Collections).emptyList()}"
th:href="@{${btn.url ?: '/'}}"
th:text="${btn.title}"
></a>
</nav>
<div
class="header-right"
>
<button
class="search-trigger"
id="search-trigger"
type="button"
th:if="${pluginFinder.available('PluginSearchWidget')}"
onclick="SearchWidget.open()"
aria-label="搜索"
>
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<span class="search-trigger-text">搜索</span>
<kbd class="search-trigger-kbd">⌘K</kbd>
</button>
<button
class="mobile-menu-toggle"
id="mobile-menu-toggle"
type="button"
th:if="${primaryMenu != null && not #lists.isEmpty(primaryMenu.menuItems)}"
aria-label="打开菜单"
aria-controls="header-menu-panel"
aria-expanded="false"
>
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
<div
class="header-menu-wrap"
id="header-menu-panel"
th:if="${primaryMenu != null && not #lists.isEmpty(primaryMenu.menuItems)}"
>
<th:block th:replace="~{header-menu :: menu}" />
</div>
<div
class="header-divider"
aria-hidden="true"
th:if="${primaryMenu != null && not #lists.isEmpty(primaryMenu.menuItems)}"
></div>
<div class="header-actions">
<th:block
th:if="${not #lists.isEmpty(theme.config.nav?.user_buttons)}"
th:each="btn : ${theme.config.nav?.user_buttons ?: T(java.util.Collections).emptyList()}"
>
<a
class="header-action-btn header-icon-btn header-action-icon-btn"
th:if="${not #strings.isEmpty(btn.svg)}"
th:href="@{${btn.url ?: '#'}}"
th:title="${btn.label}"
th:style="${not #strings.isEmpty(btn.color)} ? '--icon-color:' + btn.color : ''"
>
<span class="header-action-icon" th:utext="${btn.svg}"></span>
</a>
</th:block>
<button
class="theme-toggle header-icon-btn"
id="theme-toggle"
aria-label="切换明暗主题"
>
<svg class="icon-sun" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
<svg class="icon-moon" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
</button>
<th:block th:replace="~{user-menu :: user-menu}" />
</div>
</div>
<div
class="mobile-menu-backdrop"
id="mobile-menu-backdrop"
th:if="${primaryMenu != null && not #lists.isEmpty(primaryMenu.menuItems)}"
></div>
</div>
</header>
<main class="site-main">
<th:block
th:with="breadcrumbs = ${categoryFinder.getBreadcrumbs(category.metadata.name)},
docGroup = ${#lists.isEmpty(breadcrumbs) ? null : breadcrumbs[0]},
docEnabled = ${not #lists.isEmpty(theme.config.docs?.doc_groups) and docGroup != null and #lists.contains(theme.config.docs?.doc_groups, docGroup.metadata.name)}"
>
<th:block th:if="${docEnabled}">
<button class="sidebar-toggle" id="sidebar-toggle" aria-label="切换目录">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
<span>目录</span>
</button>
<div class="sidebar-backdrop" id="sidebar-backdrop"></div>
<div
class="doc-layout"
th:with="breadcrumbs = ${categoryFinder.getBreadcrumbs(category.metadata.name)}, docGroup = ${#lists.isEmpty(breadcrumbs) ? null : breadcrumbs[0]}"
th:attr="data-current-group=${docGroup != null ? docGroup.metadata.name : ''}, data-default-expanded=${theme.config.docs.sidebar_default_expanded}"
>
<aside class="doc-sidebar">
<div
class="doc-sidebar-header"
th:if="${not (theme.config.docs?.doc_groups != null and not #lists.isEmpty(theme.config.docs?.doc_groups) and docGroup != null and #lists.contains(theme.config.docs?.doc_groups, docGroup.metadata.name)) and theme.config.global?.show_site_name != false}"
th:text="${site.title}"
></div>
<div
class="mdocs-docsme-sidebar-controls minidocs-toolbar docgroup-toolbar"
th:if="${theme.config.docs?.doc_groups != null and not #lists.isEmpty(theme.config.docs?.doc_groups) and docGroup != null and #lists.contains(theme.config.docs?.doc_groups, docGroup.metadata.name)}"
>
<button
type="button"
class="mdocs-docsme-back"
onclick="history.back()"
>
<svg viewBox="0 0 24 24" width="15" height="15" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="19" y1="12" x2="5" y2="12"></line>
<polyline points="12 19 5 12 12 5"></polyline>
</svg>
<span>返回</span>
</button>
<button
type="button"
class="minidocs-toolbar-btn"
onclick="navigator.clipboard?.writeText(window.location.href);this.textContent='已复制'"
>
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle>
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line>
</svg>
<span>分享</span>
</button>
</div>
<div
class="minidocs-kb-heading"
th:if="${theme.config.docs?.doc_groups != null and not #lists.isEmpty(theme.config.docs?.doc_groups) and docGroup != null and #lists.contains(theme.config.docs?.doc_groups, docGroup.metadata.name)}"
>
<span class="minidocs-kb-cover">
<img
th:if="${not #strings.isEmpty(docGroup.spec.cover)}"
th:src="${docGroup.spec.cover}"
alt=""
/>
<span
class="minidocs-kb-cover-fallback"
th:unless="${not #strings.isEmpty(docGroup.spec.cover)}"
th:text="${not #strings.isEmpty(docGroup.spec.displayName) ? #strings.substring(docGroup.spec.displayName, 0, 1) : '文'}"
></span>
</span>
<div class="minidocs-kb-info">
<div class="doc-sidebar-kb-title" th:text="${docGroup.spec.displayName}"></div>
<div class="minidocs-kb-stats">
<span
th:if="${theme.config.docs?.sidebar_show_count != false}"
th:text="|共 ${docGroup.status != null and docGroup.status.postCount != null ? docGroup.status.postCount : 0} 篇文章|"
>共 0 篇文章</span>
</div>
</div>
</div>
<nav
class="doc-sidebar-nav"
>
<th:block
th:with="docTree = ${categoryFinder.listAsTree(docGroup.metadata.name)},
docChildren = ${#lists.isEmpty(docTree) ? null : docTree[0].children},
rootPosts = ${postFinder.listByCategory(1, 999, docGroup.metadata.name).items}"
>
<ul class="doc-nav-list">
<li
class="doc-nav-post"
th:each="rootPost : ${rootPosts}"
th:if="${#lists.contains(rootPost.spec.categories, docGroup.metadata.name)}"
>
<a
th:href="@{${rootPost.status.permalink}}"
th:text="${rootPost.spec.title}"
></a>
</li>
</ul>
<th:block
th:replace="~{sidebar :: sidebar(${docChildren}, ${category.metadata.name}, '')}"
/>
</th:block>
</nav>
</aside>
<div class="doc-content">
<div
class="doc-section category-overview"
th:with="categoryTree = ${categoryFinder.listAsTree(category.metadata.name)},
categoryNode = ${#lists.isEmpty(categoryTree) ? null : categoryTree[0]},
childNodes = ${categoryNode != null ? categoryNode.children : null},
categoryPosts = ${postFinder.listByCategory(1, 999, category.metadata.name).items}"
>
<div class="doc-section-header overview-header">
<h1 class="doc-section-title" th:text="${category.spec.displayName}"></h1>
</div>
<p class="doc-section-desc overview-desc" th:if="${not #strings.isEmpty(category.spec.description)}" th:text="${category.spec.description}"></p>
<div class="filter-bar" th:if="${theme.config.docs.show_filter}">
<input type="search" class="filter-input" placeholder="筛选本页内容" data-filter-target=".overview-groups" />
</div>
<div class="overview-groups">
<!-- 当前分类直属文章 -->
<section class="card-group overview-group overview-direct" th:if="${not #lists.isEmpty(categoryPosts)}">
<div class="overview-group-head">
<h2 class="card-group-title overview-group-title">
<a th:href="@{${category.status.permalink}}">本分类文章</a>
</h2>
</div>
<ul class="card-grid overview-grid">
<li
class="card-cell"
th:each="post : ${categoryPosts}"
th:if="${#lists.contains(post.spec.categories, category.metadata.name)}"
>
<a class="card-cell-link overview-card-link" th:href="@{${post.status.permalink}}">
<span class="overview-card-title" th:text="${post.spec.title}"></span>
<span
class="overview-card-desc"
th:if="${post.status != null and not #strings.isEmpty(post.status.excerpt)}"
th:text="${post.status.excerpt}"
></span>
</a>
</li>
</ul>
</section>
<!-- 直接子分类(按 Halo 分类树的子分类顺序) -->
<th:block th:if="${not #lists.isEmpty(childNodes)}">
<th:block th:each="child : ${childNodes}">
<section
class="card-group overview-group"
th:with="childPosts = ${postFinder.listByCategory(1, 999, child.metadata.name).items}"
>
<div class="overview-group-head">
<h2 class="card-group-title overview-group-title">
<a th:href="@{${child.status.permalink}}" th:text="${child.spec.displayName}"></a>
</h2>
<span
class="overview-group-count"
th:text="|共 ${#lists.size(childPosts)} 篇|"
>共 0 篇</span>
</div>
<ul class="card-grid overview-grid" th:if="${not #lists.isEmpty(childPosts)}">
<li class="card-cell" th:each="post : ${childPosts}">
<a class="card-cell-link overview-card-link" th:href="@{${post.status.permalink}}">
<span class="overview-card-title" th:text="${post.spec.title}"></span>
<span
class="overview-card-desc"
th:if="${post.status != null and not #strings.isEmpty(post.status.excerpt)}"
th:text="${post.status.excerpt}"
></span>
</a>
</li>
</ul>
<p class="overview-empty" th:unless="${not #lists.isEmpty(childPosts)}">该分类下暂无文章</p>
</section>
</th:block>
</th:block>
<p
class="doc-section-empty"
th:if="${#lists.isEmpty(categoryPosts) and #lists.isEmpty(childNodes)}"
>该分类下暂无文章</p>
</div>
<!-- 用于复制 Markdown 的数据 -->
<script type="application/json" id="page-md-data" th:text="${#strings.concat('#', category.spec.displayName, '\n\n', category.spec.description ?: '', '\n')}"></script>
</div>
</div>
</div>
</th:block>
<!-- 普通分类页面:非文档组分类 -->
<div class="container page-wrap category-page" th:unless="${docEnabled}">
<h1 class="page-title" th:text="${category.spec.displayName}"></h1>
<p class="doc-section-desc" th:if="${not #strings.isEmpty(category.spec.description)}" th:text="${category.spec.description}"></p>
<ul class="post-list category-post-list">
<li class="post-item" th:each="item : ${posts.items}">
<h2 class="post-title">
<a th:href="@{${item.status.permalink}}" th:text="${item.spec.title}"></a>
</h2>
<p class="post-meta">
<time th:text="${#temporals.format(item.spec.publishTime, 'yyyy-MM-dd')}"></time>
</p>
</li>
</ul>
<nav class="pagination" th:if="${posts.hasPrevious() or posts.hasNext()}">
<a th:if="${posts.hasPrevious()}" th:href="@{${posts.prevUrl}}">上一页</a>
<span th:text="|${posts.page} / ${posts.totalPages}|"></span>
<a th:if="${posts.hasNext()}" th:href="@{${posts.nextUrl}}">下一页</a>
</nav>
</div>
</th:block>
</main>
<footer
class="site-footer"
th:with="separateFooterLogo = ${theme.config.footer?.footer_separate_logo == true}, footerLogo = ${separateFooterLogo ? (not #strings.isEmpty(theme.config.footer?.footer_logo) ? theme.config.footer?.footer_logo : siteLogo) : siteLogo}, footerLogoDark = ${separateFooterLogo ? (not #strings.isEmpty(theme.config.footer?.footer_logo_dark) ? theme.config.footer?.footer_logo_dark : (not #strings.isEmpty(theme.config.footer?.footer_logo) ? theme.config.footer?.footer_logo : siteLogoDark)) : siteLogoDark}, showFooterName = ${theme.config.footer?.show_footer_name != false}"
>
<div class="footer-container">
<th:block
th:if="${not #lists.isEmpty(theme.config.footer?.footer_menus)}"
>
<div class="footer-menu-columns">
<th:block
th:each="menuName : ${theme.config.footer?.footer_menus}"
>
<th:block
th:with="footerMenu = ${not #strings.isEmpty(menuName) ? menuFinder.getByName(menuName) : null}"
>
<div
class="footer-menu-col"
th:if="${footerMenu != null and not #lists.isEmpty(footerMenu.menuItems)}"
>
<h4 th:text="${footerMenu.spec.displayName}"></h4>
<ul>
<li th:each="menuItem : ${footerMenu.menuItems}">
<a
th:href="@{${menuItem.status.href}}"
th:text="${menuItem.status.displayName}"
th:target="${menuItem.spec.target?.value}"
th:rel="${menuItem.spec.target?.value == '_blank'} ? 'noopener' : null"
></a>
</li>
</ul>
</div>
</th:block>
</th:block>
</div>
</th:block>
<div class="footer-bottom">
<a
class="footer-bottom-brand"
th:href="@{/}"
th:if="${not #strings.isEmpty(footerLogo) or showFooterName}"
>
<img
th:if="${not #strings.isEmpty(footerLogo)}"
th:src="${footerLogo}"
th:attr="data-logo-light=${footerLogo},data-logo-dark=${footerLogoDark}"
class="footer-bottom-logo"
alt="logo"
/>
<span
class="footer-bottom-name"
th:if="${showFooterName}"
th:text="${site.title}"
></span>
</a>
<span
class="footer-copyright"
th:if="${not #strings.isEmpty(theme.config.footer?.copyright)}"
th:text="${theme.config.footer?.copyright}"
></span>
<span
class="footer-beian"
th:if="${not #strings.isEmpty(theme.config.footer?.icp) or not #strings.isEmpty(theme.config.footer?.gongan)}"
>
<a
th:if="${not #strings.isEmpty(theme.config.footer?.icp)}"
th:href="${theme.config.footer?.icp_link ?: 'https://beian.miit.gov.cn/'}"
target="_blank"
rel="noopener"
th:text="${theme.config.footer?.icp}"
></a>
<a
class="footer-gongan"
th:if="${not #strings.isEmpty(theme.config.footer?.gongan)}"
th:href="${theme.config.footer?.gongan_link ?: 'https://beian.mps.gov.cn/#/query/webSearch'}"
target="_blank"
rel="noopener"
>
<img
th:src="@{/assets/img/gongan.svg}"
class="footer-gongan-icon"
alt=""
/>
<span th:text="${theme.config.footer?.gongan}"></span>
</a>
</span>
</div>
</div>
<halo:footer />
</footer>
<script th:inline="javascript">
window.themePluginPage = {
docs: /*[[${theme.config.docs}]]*/ {},
docsme: /*[[${theme.config.docsme}]]*/ {},
minidocs: /*[[${theme.config.minidocs}]]*/ {},
};
</script>
</body>
</html>