feat(theme): 提供i18n能力

这个提交包含在:
2025-06-27 18:32:09 +08:00 未验证
父节点 6731cb5805
当前提交 ce75a9bd4f
修改 17 个文件,包含 352 行新增20 行删除
+1 -1
查看文件
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(header = null, content = ~{::content}, footer = null)}"
th:replace="~{modules/layout :: html(title = |#{page.archives.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<div class="content">
+2 -2
查看文件
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(header = null, content = ~{::content}, footer = null)}"
th:replace="~{modules/layout :: html(title = |#{page.categories.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<div class="content">
<div class="post">
<h1 class="post-title">所有分类</h1>
<ul>
<li th:replace="~{modules/category-tree :: single(categories=${categories})}" />
<li th:replace="~{modules/category-tree :: single(categories=${categories})}"></li>
</ul>
</div>
</div>
+2 -2
查看文件
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(header = null, content = ~{::content}, footer = null)}"
th:replace="~{modules/layout :: html(title = |#{page.category.title(${category.spec.displayName})} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<div class="content">
<div class="post">
<h1
class="post-title"
th:text="'分类:'+${category.spec.displayName}+' ('+${category.status.visiblePostCount}+' 篇文章)'"
th:text="'分类:'+${category.spec.displayName}+' ('+${category.status.visiblePostCount?:0}+' 篇文章)'"
>
分类:分类名 (n 篇文章)
</h1>
+1 -1
查看文件
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(header = null, content = ~{::content}, footer = null)}"
th:replace="~{modules/layout :: html(title = ${site.title}, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<div class="content">
+1 -1
查看文件
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(header = null, content = ~{::content}, footer = null)}"
th:replace="~{modules/layout :: html(title = |#{page.links.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<script th:src="@{/assets/libs/pixelit.js}"></script>
@@ -1,7 +1,7 @@
<ul th:fragment="next (categories)">
<li th:fragment="single (categories)" th:each="category : ${categories}">
<a th:href="@{${category.status.permalink}}">
<span th:text="${category.spec.displayName}+' ('+${category.status.visiblePostCount}+' 篇文章)'"> </span>
<span th:text="${category.spec.displayName}+' ('+${category.status.visiblePostCount?:0}+' 篇文章)'"> </span>
</a>
<th:block th:if="${not #lists.isEmpty(category.children)}">
<th:block th:replace="~{modules/category-tree :: next (categories=${category.children})}"></th:block>
+5 -2
查看文件
@@ -1,11 +1,14 @@
<!DOCTYPE html>
<html lang="en" th:fragment="html (header, content, footer)">
<html
xmlns:th="https://www.thymeleaf.org"
th:lang="${#locale.toLanguageTag}"
th:fragment="html (header, content, footer)">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" th:href="${theme.config.basic.favicon}">
<title th:text="${site.title}"></title>
<title th:text="${title}"></title>
<link rel="manifest" th:href="@{/assets/dist/manifest.json}" />
<link rel="stylesheet" th:href="@{/assets/dist/main.css?version={version}(version=${theme.spec.version})}" href="./assets/dist/style.css" />
</head>
+1 -1
查看文件
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(header = null, content = ~{::content}, footer = null)}"
th:replace="~{modules/layout :: html(title = |#{page.moments.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<link rel="stylesheet" href="https://gcore.jsdelivr.net/npm/glightbox/dist/css/glightbox.min.css" />
+1 -1
查看文件
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(header = null, content = ~{::content}, footer = null)}"
th:replace="~{modules/layout :: html(title = |${singlePage.spec.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<div class="post">
+1 -1
查看文件
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(header = null, content = ~{::content}, footer = null)}"
th:replace="~{modules/layout :: html(title = |${post.spec.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<div class="post">
+2 -2
查看文件
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(header = null, content = ~{::content}, footer = null)}"
th:replace="~{modules/layout :: html(title = |#{page.tag.title(${tag.spec.displayName})} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<div class="content">
<div class="post">
<h1
class="post-title"
th:text="'标签:'+${tag.spec.displayName}+' ('+${tag.status.visiblePostCount}+' 篇文章)'"
th:text="'标签:'+${tag.spec.displayName}+' ('+${tag.status.visiblePostCount?:0}+' 篇文章)'"
>
标签:标签名 (n 篇文章)
</h1>
+2 -2
查看文件
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(header = null, content = ~{::content}, footer = null)}"
th:replace="~{modules/layout :: html(title = |#{page.tags.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<div class="content">
@@ -11,7 +11,7 @@
<li th:each="tag: ${tags}" class="tag-list">
<a
th:href="${tag.status.permalink}"
th:text="${tag.spec.displayName}+' ('+${tag.status.visiblePostCount}+' 篇文章)'"
th:text="${tag.spec.displayName}+' ('+${tag.status.visiblePostCount?:0}+' 篇文章)'"
>
标签名 (n 篇文章)
</a>