初始化政体志子站
收录 zhengquan-site 前后端完整代码:24 朝数据、24 幅权力结构图、 5 条沿革(67 节点 / 269 条细释)、44 个词条,以及部署配置与接口测试。
This commit is contained in:
commit
aa12b9f910
58 files changed
+16253
No files matched your search
@@ -0,0 +1,68 @@
|
||||
import { site } from './store.js';
|
||||
import { esc } from './util.js';
|
||||
|
||||
const NAV = [
|
||||
{ key: '', href: '#/', label: '总览' },
|
||||
{ key: 'threads', href: '#/threads', label: '沿革' },
|
||||
{ key: 'glossary', href: '#/glossary', label: '词典' },
|
||||
];
|
||||
|
||||
function activeKey(path) {
|
||||
const seg = path.split('/').filter(Boolean)[0] || '';
|
||||
if (seg === 'dynasty') return '';
|
||||
if (seg === 'thread') return 'threads';
|
||||
return seg;
|
||||
}
|
||||
|
||||
export function header(path) {
|
||||
const s = site();
|
||||
const key = activeKey(path);
|
||||
const nav = NAV.map((item) => {
|
||||
const cls = item.key === key ? ' class="active"' : '';
|
||||
return `<a href="${item.href}"${cls}>${item.label}</a>`;
|
||||
}).join('');
|
||||
|
||||
return `
|
||||
<header class="topbar">
|
||||
<div class="topbar-inner">
|
||||
<a class="brand" href="#/" aria-label="${esc(s.brand)} ${esc(s.name)} 首页">
|
||||
<span class="seal" aria-hidden="true">${esc(s.seal)}</span>
|
||||
<span class="brand-text"><b>${esc(s.brand)}</b><i>${esc(s.name)}</i></span>
|
||||
</a>
|
||||
<nav class="nav" aria-label="主导航">${nav}</nav>
|
||||
<div class="top-actions">
|
||||
<form class="quick-search" data-quick-search role="search">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>
|
||||
<input name="q" type="search" placeholder="检索全志" aria-label="检索朝代、机构、制度与词条" autocomplete="off" />
|
||||
<kbd>/</kbd>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</header>`;
|
||||
}
|
||||
|
||||
export function footer() {
|
||||
return `
|
||||
<footer class="site-foot">
|
||||
<div class="foot-inner">
|
||||
<div>
|
||||
<p class="fslogan">国体为本,官制为骨</p>
|
||||
<p class="fmeta">
|
||||
舆纪历史 编 · © 2026 incarnation.cn ·
|
||||
<a href="https://beian.miit.gov.cn" target="_blank" rel="noopener">冀ICP备2026017366号-1</a> ·
|
||||
<a href="https://incarnation.cn/terms.html" target="_blank" rel="noopener">版权与条款</a>
|
||||
</p>
|
||||
</div>
|
||||
<nav class="foot-links" aria-label="舆纪各站">
|
||||
<a href="https://incarnation.cn/" target="_blank" rel="noopener">总站</a>
|
||||
<a href="https://lishi.incarnation.cn" target="_blank" rel="noopener">历史事件地图</a>
|
||||
<a href="https://wenwu.incarnation.cn" target="_blank" rel="noopener">流失文物档案</a>
|
||||
<a href="https://ditu.incarnation.cn" target="_blank" rel="noopener">历史地图</a>
|
||||
</nav>
|
||||
</div>
|
||||
</footer>`;
|
||||
}
|
||||
|
||||
export function shell(inner, path) {
|
||||
return header(path) + `<main class="wrap page fade-in">${inner}</main>` + footer();
|
||||
}
|
||||
Reference in new issue
Block a user