新增 new-post 脚本与操作指南文档

- scripts/new-post.mjs + pnpm new-post:按标题建文章,支持 --category/--tags/
  --description/--image/--file/--pinned/--draft,标题里的冒号引号会正确转义
- docs/操作指南.md:写文章、发偶得、加相册、预览、检查、部署的完整流程
- 修复 astro check 报出的 2 个类型错误(gallery 索引页 querySelector 未指定
  HTMLElement,导致 dataset 不可用)。现在 pnpm check 为 0 error
This commit is contained in:
dsh
2026-09-14 20:50:22 +08:00
parent e029c69899
commit 686b1caa7d
5 changed files with 381 additions and 1 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ const allTags = getAllAlbumTags(albums)
<script>
// 标签筛选。ClientRouter 切页后需要重新绑定,所以监听 astro:page-load。
const initAlbumFilter = () => {
const filter = document.querySelector("[data-album-filter]")
const filter = document.querySelector<HTMLElement>("[data-album-filter]")
if (!filter || filter.dataset.bound === "true") return
filter.dataset.bound = "true"