43 lines
1.9 KiB
HTML
43 lines
1.9 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="detail-main">
|
|
<nav class="breadcrumb">
|
|
<a th:href="${url.home()}">首页</a>
|
|
<a th:if="${currentCategoryId != null}" th:href="${url.category(currentCategoryId)}">栏目</a>
|
|
<span>正文</span>
|
|
</nav>
|
|
|
|
<article class="article">
|
|
<h1 class="article-title" th:text="${article.title}">文章标题</h1>
|
|
<div class="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="article-content" th:utext="${article.content}">正文</div>
|
|
</article>
|
|
|
|
<nav class="article-sibling">
|
|
<a th:if="${prevArticle != null}" class="prev"
|
|
th:href="${url.article(prevArticle.id)}"
|
|
th:text="'上一篇:' + ${prevArticle.title}">上一篇</a>
|
|
<a th:if="${nextArticle != null}" class="next"
|
|
th:href="${url.article(nextArticle.id)}"
|
|
th:text="'下一篇:' + ${nextArticle.title}">下一篇</a>
|
|
</nav>
|
|
</main>
|
|
|
|
<footer th:replace="~{${themeBase} + '/fragments/footer' :: footer}"></footer>
|
|
</body>
|
|
</html>
|