初始化仓库

初始化仓库
This commit is contained in:
2026-09-09 13:19:09 +08:00
parent 484d3877aa
commit d36050cff7
3289 changed files with 499918 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
const fs = require('fs');
let c = fs.readFileSync('src/index.html', 'utf8');
// 1. modules 兜底为空列表
c = c.replace(
' <div class="homepage">\n <th:block th:each="mod : ${theme.config.homepage.modules}">',
' <div class="homepage">\n <th:block th:with="modules = ${theme.config.homepage?.modules ?: #lists.toList()}">\n <th:block th:each="mod : ${modules}">'
);
c = c.replace(
' </th:block>\n\n </th:block>\n\n <section class="section browse"',
' </th:block>\n\n </th:block>\n </th:block>\n\n <section class="section browse"'
);
// 2. 所有 th:each="x : ${mod.xxx}" 加 ?: #lists.toList() 兜底
c = c.replace(/th:each="([^"]+) : \$\{mod\.(\w+)\}"/g, 'th:each="$1 : ${mod.$2 ?: #lists.toList()}"');
fs.writeFileSync('src/index.html', c);
console.log('done');