门户:在首页上改地址栏的旧地址(#/gallery、#0003…)也会跳到新页面;资源版本号 v2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -71,12 +71,13 @@
|
||||
})();
|
||||
|
||||
/* ---------- 旧链接兼容:原来的单页版地址(#/gallery、#/universe、#0001 …)跳到对应的新页面 ---------- */
|
||||
if (page === 'home' && location.hash) {
|
||||
function legacy() {
|
||||
var h = location.hash.replace(/^#\/?/, '').replace(/\/+$/, '');
|
||||
var map = { gallery: 'gallery.html', apps: 'tools.html', universe: 'universe.html', rack: 'universe.html', links: 'links.html', about: 'about.html' };
|
||||
if (map[h]) location.replace(map[h] + location.search);
|
||||
else if (/^\d{4}$/.test(h)) location.replace('universe.html' + location.search + '#' + h);
|
||||
}
|
||||
if (page === 'home') { if (location.hash) legacy(); addEventListener('hashchange', legacy); } // 在首页上改地址栏的 # 也要跳
|
||||
|
||||
/* ---------- 共用小件 ---------- */
|
||||
var GALLERY = (C.gallery || []).filter(function (g) { return !g.hidden; });
|
||||
|
||||
Reference in New Issue
Block a user