feat(site): 首页主视觉换成油画(AI 生成),加白纱/颗粒/缓慢缩放/滚动入场/视差;资源加时间戳防缓存
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m56s

This commit is contained in:
qiqi committed 2026-11-17 20:24:22 +08:00
1 parent 99480bf9c5
commit fbdaf48377
10 files changed
+156 -10

No files matched your search

+1 -1
View File
@@ -55,7 +55,7 @@ const html = `<!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>${esc(data.app)} · 下载</title>
<link rel="stylesheet" href="/assets/style.css">
<link rel="stylesheet" href="/assets/style.css?v=" + encodeURIComponent(latest.version + '-' + Date.now().toString(36)) + "">
<style>
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
+5 -2
View File
@@ -15,6 +15,7 @@ const rel = Array.isArray(data.releases) ? data.releases.slice() : (Array.isArra
rel.sort((a, b) => String(b.version).localeCompare(String(a.version), undefined, { numeric: true }))
const latest = rel[0] || { version: '', platforms: {} }
const V = esc(latest.version)
const STAMP = encodeURIComponent(V + '-' + Date.now().toString(36))
const marketFile = path.join(root, 'market', 'index.json')
const market = fs.existsSync(marketFile) ? JSON.parse(fs.readFileSync(marketFile, 'utf8')) : { plugins: [] }
@@ -88,7 +89,7 @@ function render(tpl, map) {
return out
}
const home = render('_home.tpl.html', {
let home = render('_home.tpl.html', {
NAV: nav('home'),
FOOTER: footer,
VERSION: V,
@@ -97,9 +98,10 @@ const home = render('_home.tpl.html', {
PLUGIN_CARDS: plugins.slice(0, 6).map((p) => card(p).replace(/^\s+/, ' ')).join('\n'),
DL_CARDS: dlCards,
})
home = home.replace('/assets/style.css', '/assets/style.css?v=' + STAMP).replace('/assets/painting.jpg', '/assets/painting.jpg?v=' + STAMP)
fs.writeFileSync(path.join(site, 'index.html'), home)
const pluginsPage = render('_plugins.tpl.html', {
let pluginsPage = render('_plugins.tpl.html', {
NAV: nav('plugins'),
FOOTER: footer,
PLUGIN_COUNT: String(plugins.length),
@@ -107,6 +109,7 @@ const pluginsPage = render('_plugins.tpl.html', {
PLUGIN_CARDS: plugins.map(card).join('\n'),
})
fs.mkdirSync(path.join(site, 'plugins'), { recursive: true })
pluginsPage = pluginsPage.replace('/assets/style.css', '/assets/style.css?v=' + STAMP)
fs.writeFileSync(path.join(site, 'plugins', 'index.html'), pluginsPage)
fs.writeFileSync(path.join(site, 'plugins-index.json'), JSON.stringify(market, null, 2) + '\n')