Skip to content

Commit 49406cf

Browse files
author
jimmycppliu
committed
feat: 后台改为侧边栏布局,主页只保留单个创作入口
1 parent a7b48b1 commit 49406cf

17 files changed

Lines changed: 714 additions & 379 deletions

‎admin/diagnose.html‎

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,13 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>后台诊断</title>
7-
<link rel="stylesheet" href="../assets/css/common.css?v=20260512">
8-
<link rel="stylesheet" href="../assets/css/admin.css?v=20260512">
7+
<link rel="stylesheet" href="../assets/css/common.css?v=20260513">
8+
<link rel="stylesheet" href="../assets/css/admin.css?v=20260513">
99
<script>(function(){var t=localStorage.getItem('blog_theme')||'auto';var d=t==='auto'?window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light':t;document.documentElement.setAttribute('data-theme',d);document.documentElement.dataset.themeChoice=t;})();</script>
1010
</head>
1111
<body class="admin-page">
12-
<header class="nav">
13-
<div class="nav-inner">
14-
<a class="nav-logo" href="../">
15-
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2L2 7v10l10 5 10-5V7L12 2zm0 2.18L19.82 8 12 11.82 4.18 8 12 4.18zM4 9.27l7 3.5v7.46l-7-3.5V9.27zm9 10.96v-7.46l7-3.5v7.46l-7 3.5z"/></svg>
16-
<span>诊断</span>
17-
</a>
18-
<a class="nav-link" href="./">返回管理</a>
19-
<a class="nav-link" href="settings.html">设置</a>
20-
<div class="nav-spacer"></div>
21-
</div>
22-
</header>
12+
<div id="app"></div>
2313

24-
<main class="admin-layout">
25-
<div class="admin-toolbar">
26-
<h2>系统诊断</h2>
27-
<button class="btn btn-primary" id="rerun">重新检查</button>
28-
</div>
29-
<div class="diagnose-list" id="list"></div>
30-
</main>
31-
32-
<script type="module" src="../assets/js/diagnose.js?v=20260512"></script>
14+
<script type="module" src="../assets/js/diagnose.js?v=20260513"></script>
3315
</body>
3416
</html>

‎admin/editor.html‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>编辑文章</title>
7-
<link rel="stylesheet" href="../assets/css/common.css?v=20260512">
8-
<link rel="stylesheet" href="../assets/css/admin.css?v=20260512">
9-
<link rel="stylesheet" href="../assets/css/post.css?v=20260512">
7+
<link rel="stylesheet" href="../assets/css/common.css?v=20260513">
8+
<link rel="stylesheet" href="../assets/css/admin.css?v=20260513">
9+
<link rel="stylesheet" href="../assets/css/post.css?v=20260513">
1010
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde@2.18.0/dist/easymde.min.css">
1111
<script>(function(){var t=localStorage.getItem('blog_theme')||'auto';var d=t==='auto'?window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light':t;document.documentElement.setAttribute('data-theme',d);document.documentElement.dataset.themeChoice=t;})();</script>
1212
</head>
@@ -52,6 +52,6 @@ <h1 class="article-title" id="previewTitle">预览</h1>
5252
</div>
5353

5454
<script src="https://cdn.jsdelivr.net/npm/easymde@2.18.0/dist/easymde.min.js"></script>
55-
<script type="module" src="../assets/js/editor.js?v=20260512"></script>
55+
<script type="module" src="../assets/js/editor.js?v=20260513"></script>
5656
</body>
5757
</html>

‎admin/index.html‎

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,14 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>后台 · 加载中…</title>
7-
<link rel="stylesheet" href="../assets/css/common.css?v=20260512">
8-
<link rel="stylesheet" href="../assets/css/admin.css?v=20260512">
6+
<title>创作后台</title>
7+
<link rel="stylesheet" href="../assets/css/common.css?v=20260513">
8+
<link rel="stylesheet" href="../assets/css/admin.css?v=20260513">
99
<script>(function(){var t=localStorage.getItem('blog_theme')||'auto';var d=t==='auto'?window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light':t;document.documentElement.setAttribute('data-theme',d);document.documentElement.dataset.themeChoice=t;})();</script>
1010
</head>
1111
<body class="admin-page">
12-
<header class="nav">
13-
<div class="nav-inner">
14-
<a class="nav-logo" href="../">
15-
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2L2 7v10l10 5 10-5V7L12 2zm0 2.18L19.82 8 12 11.82 4.18 8 12 4.18zM4 9.27l7 3.5v7.46l-7-3.5V9.27zm9 10.96v-7.46l7-3.5v7.46l-7 3.5z"/></svg>
16-
<span>后台</span>
17-
</a>
18-
<a class="nav-link" href="settings.html">设置</a>
19-
<a class="nav-link" href="diagnose.html">诊断</a>
20-
<div class="nav-spacer"></div>
21-
<button id="themeToggleHost" class="icon-btn" title="切换主题"></button>
22-
<div class="nav-actions" id="navActions"></div>
23-
</div>
24-
</header>
12+
<div id="app"></div>
2513

26-
<main id="main"></main>
27-
28-
<script type="module" src="../assets/js/admin.js?v=20260512"></script>
14+
<script type="module" src="../assets/js/admin.js?v=20260513"></script>
2915
</body>
3016
</html>

‎admin/settings.html‎

Lines changed: 4 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -4,103 +4,13 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>站点设置</title>
7-
<link rel="stylesheet" href="../assets/css/common.css?v=20260512">
8-
<link rel="stylesheet" href="../assets/css/admin.css?v=20260512">
7+
<link rel="stylesheet" href="../assets/css/common.css?v=20260513">
8+
<link rel="stylesheet" href="../assets/css/admin.css?v=20260513">
99
<script>(function(){var t=localStorage.getItem('blog_theme')||'auto';var d=t==='auto'?window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light':t;document.documentElement.setAttribute('data-theme',d);document.documentElement.dataset.themeChoice=t;})();</script>
1010
</head>
1111
<body class="admin-page">
12-
<header class="nav">
13-
<div class="nav-inner">
14-
<a class="nav-logo" href="../">
15-
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2L2 7v10l10 5 10-5V7L12 2zm0 2.18L19.82 8 12 11.82 4.18 8 12 4.18zM4 9.27l7 3.5v7.46l-7-3.5V9.27zm9 10.96v-7.46l7-3.5v7.46l-7 3.5z"/></svg>
16-
<span>站点设置</span>
17-
</a>
18-
<a class="nav-link" href="./">文章</a>
19-
<a class="nav-link active" href="settings.html">设置</a>
20-
<a class="nav-link" href="diagnose.html">诊断</a>
21-
<div class="nav-spacer"></div>
22-
<button class="btn btn-primary" id="saveTop">保存设置</button>
23-
</div>
24-
</header>
12+
<div id="app"></div>
2513

26-
<main class="admin-layout">
27-
<div class="admin-toolbar">
28-
<h2>站点基础配置</h2>
29-
<span class="editor-status" id="status">未保存</span>
30-
<button class="btn btn-secondary" id="resetBtn">恢复当前配置</button>
31-
<button class="btn btn-primary" id="saveBtn">保存设置</button>
32-
</div>
33-
34-
<form id="settingsForm" class="settings-form">
35-
<section class="settings-card">
36-
<h3>站点信息</h3>
37-
<div class="settings-grid">
38-
<label>站点名称 <input name="site.title" placeholder="我的博客"></label>
39-
<label>副标题 <input name="site.subtitle" placeholder="记录想法与代码"></label>
40-
<label>作者名 <input name="site.author" placeholder="作者"></label>
41-
<label>站点 URL <input name="site.url" placeholder="https://user.github.io/repo"></label>
42-
<label class="span-2">描述 <textarea name="site.description" rows="3" placeholder="一句话介绍你的博客"></textarea></label>
43-
<label>头像 URL <input name="site.avatar" placeholder="https://..."></label>
44-
<label>Logo URL <input name="site.logo" placeholder="可选,顶部导航图标"></label>
45-
<label>Favicon URL <input name="site.favicon" placeholder="可选,浏览器标签页图标"></label>
46-
<label>语言 <input name="site.locale" placeholder="zh-CN"></label>
47-
</div>
48-
</section>
49-
50-
<section class="settings-card">
51-
<h3>仓库与权限</h3>
52-
<p class="settings-help">这里决定后台保存到哪个 GitHub 仓库。修改仓库名后,本次保存仍会写到当前仓库,下一次刷新后新配置才生效。</p>
53-
<div class="settings-grid">
54-
<label>owner <input name="repo.owner" placeholder="flymysql"></label>
55-
<label>repo name <input name="repo.name" placeholder="gitblog"></label>
56-
<label>branch <input name="repo.branch" placeholder="main"></label>
57-
<label class="span-2">后台白名单(逗号或换行分隔) <textarea name="authorizedUsers" rows="3" placeholder="flymysql"></textarea></label>
58-
</div>
59-
</section>
60-
61-
<section class="settings-card">
62-
<h3>导航与社交链接</h3>
63-
<div class="settings-grid">
64-
<label>GitHub <input name="site.social.github" placeholder="https://github.com/xxx"></label>
65-
<label>Twitter / X <input name="site.social.twitter" placeholder="https://x.com/xxx"></label>
66-
<label>Email <input name="site.social.email" placeholder="name@example.com"></label>
67-
<label>RSS <input name="site.social.rss" placeholder="rss.xml"></label>
68-
<label class="span-2">顶部导航(JSON 数组) <textarea name="site.nav" rows="8" spellcheck="false"></textarea></label>
69-
</div>
70-
</section>
71-
72-
<section class="settings-card">
73-
<h3>评论(giscus)</h3>
74-
<p class="settings-help">需要先在 GitHub 仓库启用 Discussions,然后到 giscus.app 生成 repoId 和 categoryId。</p>
75-
<div class="settings-grid">
76-
<label class="settings-check"><input type="checkbox" name="giscus.enabled"> 启用 giscus 评论</label>
77-
<label>repo <input name="giscus.repo" placeholder="owner/repo"></label>
78-
<label>repoId <input name="giscus.repoId"></label>
79-
<label>category <input name="giscus.category"></label>
80-
<label>categoryId <input name="giscus.categoryId"></label>
81-
<label>mapping <input name="giscus.mapping" placeholder="pathname"></label>
82-
<label>language <input name="giscus.lang" placeholder="zh-CN"></label>
83-
</div>
84-
</section>
85-
86-
<section class="settings-card">
87-
<h3>路径与主题</h3>
88-
<div class="settings-grid">
89-
<label>文章目录 <input name="paths.posts" placeholder="posts"></label>
90-
<label>索引文件 <input name="paths.index" placeholder="data/posts.json"></label>
91-
<label>上传目录 <input name="paths.uploads" placeholder="assets/uploads"></label>
92-
<label>默认主题
93-
<select name="theme.default">
94-
<option value="auto">跟随系统</option>
95-
<option value="light">浅色</option>
96-
<option value="dark">深色</option>
97-
</select>
98-
</label>
99-
</div>
100-
</section>
101-
</form>
102-
</main>
103-
104-
<script type="module" src="../assets/js/settings.js?v=20260512"></script>
14+
<script type="module" src="../assets/js/settings.js?v=20260513"></script>
10515
</body>
10616
</html>

‎archives.html‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>归档 · 加载中…</title>
77
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
8-
<link rel="stylesheet" href="assets/css/common.css?v=20260512">
9-
<link rel="stylesheet" href="assets/css/home.css?v=20260512">
8+
<link rel="stylesheet" href="assets/css/common.css?v=20260513">
9+
<link rel="stylesheet" href="assets/css/home.css?v=20260513">
1010
<script>(function(){var t=localStorage.getItem('blog_theme')||'auto';var d=t==='auto'?window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light':t;document.documentElement.setAttribute('data-theme',d);document.documentElement.dataset.themeChoice=t;})();</script>
1111
<style>
1212
.archive-page { max-width: var(--content-max); margin: 28px auto; padding: 0 24px; }
@@ -51,6 +51,6 @@ <h1>归档</h1>
5151
<div id="site-footer"></div>
5252
<div id="site-overlays"></div>
5353

54-
<script type="module" src="assets/js/archives.js?v=20260512"></script>
54+
<script type="module" src="assets/js/archives.js?v=20260513"></script>
5555
</body>
5656
</html>

0 commit comments

Comments
 (0)