添加修订功能

This commit is contained in:
biss committed 2026-07-17 16:56:32 +08:00
1 parent c9384526a6
commit ed5c0c343a
7 files changed
+306 -11

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
---
import type { PostChangelogEntry } from '@/lib/posts';
interface Props {
entries: PostChangelogEntry[];
}
const { entries } = Astro.props;
---
<section class="post-changelog" id="article-changelog" aria-labelledby="article-changelog-title">
<header class="post-changelog-head">
<div class="post-changelog-icon" aria-hidden="true"><i class="fa-solid fa-clock-rotate-left"></i></div>
<div>
<span>REVISION HISTORY</span>
<h2 id="article-changelog-title">文章修订记录</h2>
</div>
<strong>{entries.length} 次</strong>
</header>
<ol class="post-changelog-list">
{entries.map((entry) => (
<li>
<span class="post-changelog-marker" aria-hidden="true"></span>
<div class="post-changelog-entry">
<div>
<h3>{entry.title}</h3>
{entry.date && <time datetime={entry.date.toISOString()}>{entry.dateText}</time>}
</div>
{entry.description && <p>{entry.description}</p>}
</div>
</li>
))}
</ol>
</section>
+5
View File
@@ -17,6 +17,11 @@ const posts = defineCollection({
cover: z.any().optional(), cover: z.any().optional(),
series: z.any().optional(), series: z.any().optional(),
seriesOrder: z.any().optional(), seriesOrder: z.any().optional(),
changelog: z.any().optional(),
newVersion: z.any().optional(),
newVersionTitle: z.any().optional(),
supersededBy: z.any().optional(),
replacement: z.any().optional(),
}).passthrough(), }).passthrough(),
}); });
@@ -3,6 +3,13 @@ title: 使用GitHub推送Hexo到服务器
categories: 建站手札 categories: 建站手札
cover: https://pic.biss.click/image/e0a08509-dea4-4af7-bafa-c81ca9d1cf8d.webp cover: https://pic.biss.click/image/e0a08509-dea4-4af7-bafa-c81ca9d1cf8d.webp
series: webcustom series: webcustom
updated: 2026-07-17 13:20:00
newVersion: 8f3b9d21
newVersionTitle: 网站迁移日志:从 Hexo 到 Astro
changelog:
- date: 2026-07-17 13:20:00
title: 增加新版入口
description: 标记本文为早期 Hexo 部署记录,并补充当前 Astro 版本的网站迁移日志入口。
tags: 网站 tags: 网站
abbrlink: ce1ec3fe abbrlink: ce1ec3fe
summary: >- summary: >-
@@ -135,4 +142,4 @@ jobs:
`KEY`:密钥(私钥) `KEY`:密钥(私钥)
`PORT`:SSH登录端口,一般为22 `PORT`:SSH登录端口,一般为22
# 测试 # 测试
运行一下这个Action无报错即可。 运行一下这个Action无报错即可。
Loaded 3 of 7 files, more files were not shown because too many files have changed in this diff. Show more