77 lines
4.2 KiB
HTML
77 lines
4.2 KiB
HTML
<!DOCTYPE html>
|
|
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
|
|
<head th:replace="~{${themeBase} + '/fragments/head' :: head}"></head>
|
|
<body>
|
|
<header th:replace="~{${themeBase} + '/fragments/header' :: header}"></header>
|
|
|
|
<main class="cg-list-main cg-container" id="main-content">
|
|
<div class="cg-page-cols">
|
|
<!-- 左侧栏目导航(docs/11 侧栏契约):模块有二级子栏目时展示"模块名 + 全部兄弟" -->
|
|
<aside class="cg-side-nav" th:if="${sideNav != null}" aria-label="栏目导航">
|
|
<div class="cg-side-nav-head" th:text="${sideNav.top.name}">模块名</div>
|
|
<ul class="cg-side-nav-list">
|
|
<li class="cg-side-nav-item" th:each="item : ${sideNav.items}"
|
|
th:classappend="${item.id == sideNav.activeId} ? 'active'">
|
|
<a th:if="${item.type == 3}" th:href="${item.linkUrl}" target="_blank" rel="noopener"
|
|
th:text="${item.name}">子栏目</a>
|
|
<a th:unless="${item.type == 3}" th:href="${url.category(item.id)}" th:text="${item.name}">子栏目</a>
|
|
</li>
|
|
</ul>
|
|
</aside>
|
|
|
|
<div class="cg-page-card">
|
|
<nav class="cg-breadcrumb" aria-label="面包屑">
|
|
<a th:href="${url.home()}">首页</a>
|
|
<th:block th:each="node : ${categoryPath}">
|
|
<span class="cg-crumb-sep" aria-hidden="true">/</span>
|
|
<a class="cg-crumb-parent" th:href="${url.category(node.id)}" th:text="${node.name}">栏目</a>
|
|
</th:block>
|
|
<span class="cg-crumb-sep" th:if="${currentCategoryId != null}" aria-hidden="true">/</span>
|
|
<span class="cg-current">正文</span>
|
|
</nav>
|
|
|
|
<article class="cg-article">
|
|
<h1 class="cg-article-title" th:text="${article.title}">文章标题</h1>
|
|
<div class="cg-article-meta">
|
|
<time th:if="${article.publishTime != null}"
|
|
th:text="${'发布时间:' + #temporals.format(article.publishTime, 'yyyy-MM-dd HH:mm')}">2026-01-01 10:00</time>
|
|
<span th:if="${!#strings.isEmpty(article.authorName)}"
|
|
th:text="'作者:' + ${article.authorName}">作者</span>
|
|
<span th:if="${!#strings.isEmpty(article.source)}"
|
|
th:text="'来源:' + ${article.source}">来源</span>
|
|
<span th:text="'浏览量:' + ${article.viewCount}">浏览量</span>
|
|
</div>
|
|
<!-- 正文:入库前已经 jsoup 白名单清洗(方案 §8.5),此处允许 utext;
|
|
其余字段一律 th:text 转义输出 -->
|
|
<div class="cg-article-content" th:utext="${article.content}">正文</div>
|
|
</article>
|
|
|
|
<nav class="cg-article-sibling" aria-label="上下篇导航">
|
|
<a th:if="${prevArticle != null}" class="prev"
|
|
th:href="${url.article(prevArticle.id)}">
|
|
<span class="cg-sib-label">上一篇</span>
|
|
<span class="cg-sib-title" th:text="${prevArticle.title}">上一篇标题</span>
|
|
</a>
|
|
<span class="cg-sib-none prev" th:if="${prevArticle == null}">
|
|
<span class="cg-sib-label">上一篇</span>
|
|
<span class="cg-sib-title">已经是最早一篇</span>
|
|
</span>
|
|
<a th:if="${nextArticle != null}" class="next"
|
|
th:href="${url.article(nextArticle.id)}">
|
|
<span class="cg-sib-label">下一篇</span>
|
|
<span class="cg-sib-title" th:text="${nextArticle.title}">下一篇标题</span>
|
|
</a>
|
|
<span class="cg-sib-none next" th:if="${nextArticle == null}">
|
|
<span class="cg-sib-label">下一篇</span>
|
|
<span class="cg-sib-title">已是最新一篇</span>
|
|
</span>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<footer th:replace="~{${themeBase} + '/fragments/footer' :: footer}"></footer>
|
|
<script th:src="${url.asset('js/main.js')}"></script>
|
|
</body>
|
|
</html>
|