From 1a6e10237970cf4beff9fc8444b3fa101023a40d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A1=B5?= Date: Sun, 8 Nov 2026 20:25:43 +0800 Subject: [PATCH 1/6] fix(cms): publish new articles by default --- public/admin/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/admin/config.yml b/public/admin/config.yml index 2e0bb40..a6e38f3 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -94,7 +94,7 @@ collections: name: draft widget: boolean required: false - default: true + default: false hint: 打开时文章不会出现在公开网站中。关闭后发布才能上线。 - label: 文章语言 name: lang @@ -255,7 +255,7 @@ collections: name: draft widget: boolean required: false - default: true + default: false hint: 打开时文章不会出现在公开网站中。关闭后发布才能上线。 - label: 文章语言 name: lang From 5a029f9705dd7b324627b07d953017a37fdea9ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A1=B5?= Date: Sun, 8 Nov 2026 20:25:45 +0800 Subject: [PATCH 2/6] fix(cms): publish new articles by default --- tests/cms-editor.test.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cms-editor.test.mjs b/tests/cms-editor.test.mjs index 2b568a7..6f0f5d2 100644 --- a/tests/cms-editor.test.mjs +++ b/tests/cms-editor.test.mjs @@ -84,7 +84,7 @@ test('new article switches match site habits while existing article data is not for (const key of ['comment', 'encrypted', 'coverInContent', 'pinned']) { assert.equal(fields.find(field => field.name === key).default, false, `${name}.${key}`); } - assert.equal(fields.find(field => field.name === 'draft').default, true); + assert.equal(fields.find(field => field.name === 'draft').default, false, `${name}.draft`); const copy = fields.find(field => field.name === 'copyProtection'); assert.equal(copy.collapsed, true); assert.ok(copy.fields.every(field => field.default === false)); From 075a6d62eb0ff97af7b44ca4e16aee7a4da25939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A1=B5?= Date: Sun, 8 Nov 2026 20:25:47 +0800 Subject: [PATCH 3/6] fix(cms): publish new articles by default --- CMS_SETUP.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMS_SETUP.md b/CMS_SETUP.md index 10ec736..aa25380 100644 --- a/CMS_SETUP.md +++ b/CMS_SETUP.md @@ -7,13 +7,13 @@ 1. 左侧选择“文章”,点击“+文章”。只有需要 import、JSX 或自定义 MDX 布局时才选择“MDX 文章”。 2. 填写标题、发布日期(可点“现在”)、摘要、分类。封面可直接选择或上传。 3. 在“正文”里写内容。默认使用 Markdown 源码,普通文章需要时可点“切换为富文本”。包含高级语法的文章保持源码模式。 -4. **保存草稿:** “高级设置”中的“草稿”默认开启,点击顶部“发布 → 立即发布”。文章会保存到 GitHub,但不会公开展示。 -5. **正式上线:** 展开“高级设置”,关闭“草稿”开关,再点击“发布 → 立即发布”。后台自动提交到 main,现有 GitHub Actions 随后构建并部署网站。 +4. **保存草稿:** 新建 Markdown 和 MDX 文章时,“高级设置”中的“草稿”默认关闭。若想保存草稿,请先打开“草稿”开关,再点击顶部“发布 → 立即发布”。文章会保存到 GitHub,但不会公开展示。 +5. **正式上线:** 新文章默认不是草稿,直接点击“发布 → 立即发布”即可公开发布。对于已有草稿,需要先在“高级设置”中关闭“草稿”开关,再发布。后台自动提交到 main,现有 GitHub Actions 随后构建并部署网站。 6. “内容已保存”代表 GitHub 保存完成;网站更新需要等待[部署流程](https://github.com/Chen017/Blog/actions/workflows/deploy.yml)成功。然后打开文章页面查看。 修改旧文章也用相同流程。改标题不会自动迁移已有文章文件;“固定地址”通常留空,已有值不要随意改动。新文章自动创建目录和 index.md / index.mdx,不用手动建文件夹。 -新文章默认关闭评论、密码保护、所有复制限制、置顶和正文显示封面;“草稿”默认开启,避免误上线。已有文章保留原来的设置。评论还受网站全局开关控制,当前全局关闭。 +新文章默认关闭评论、密码保护、所有复制限制、置顶和正文显示封面;“草稿”默认关闭,点击“发布 → 立即发布”即为公开发布。已有文章保留原来的设置。评论还受网站全局开关控制,当前全局关闭。 正文封面、置顶、草稿、语言、固定地址、评论、密码和复制限制都收在默认关闭的“高级设置”里。收起时仍会显示草稿或公开状态,折叠不会改变已保存的值。 From 6c6d7cee32ec494da3a4e36fbfea5f0496155e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A1=B5?= Date: Sun, 8 Nov 2026 20:25:49 +0800 Subject: [PATCH 4/6] fix(cms): publish new articles by default --- README.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index ab6ce3a..2470bd5 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -43,7 +43,7 @@ 1. 选择**文章**创建 Markdown 文章;需要导入文件或自定义布局时,选择 **MDX 文章**。 2. 填写标题、发布日期、摘要和分类,直接在编辑器中上传封面和正文图片。 3. 使用**常用组件**表单插入音乐卡片、图片、提示框、遮罩文字、公式和 Mermaid 图表。音乐卡片支持直接上传,也支持已有的外部音频链接;外部音频无需下载到仓库中。 -4. 保持**草稿**开关开启,点击**发布 → 立即发布**即可保存草稿。准备公开文章时,先关闭草稿开关再发布。 +4. 新文章的**草稿**开关默认关闭,点击**发布 → 立即发布**即可公开文章。如需保存草稿,请先开启草稿开关再发布;已有草稿需要关闭开关才能公开。 在线保存会提交到 `main` 分支,并触发 GitHub Actions 自动部署。部署成功后,公开文章才会出现在网站上。已有高级 Markdown 和 MDX 使用源码编辑,以保留原有语法;最终效果以博客页面为准。 From aa7c3fe78d2471a8ca3f09d342073fef8f1f4991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A1=B5?= Date: Sun, 8 Nov 2026 20:25:52 +0800 Subject: [PATCH 5/6] fix(cms): publish new articles by default --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7722f3b..a44c4c9 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Open [the writing dashboard](https://www.etalib.space/admin/) and sign in with y 1. Select the **articles** collection to create a Markdown article, or the **MDX articles** collection for content that uses imports and custom layouts. 2. Fill in the title, publication date, summary, and category. Upload the cover and body images directly in the editor. 3. Use the **common component forms** for music cards, images, admonitions, spoilers, formulas, and Mermaid diagrams. Music cards support both uploads and existing external audio links; external audio does not need to be downloaded into the repository. -4. Keep the **draft** switch enabled and choose **Publish → Publish now** to save a draft. Turn the draft switch off before publishing an article publicly. +4. New articles have the **draft** switch off by default: choose **Publish → Publish now** to publish publicly. To save a draft, turn the switch on first; turn it off to publish an existing draft. Online saves commit to `main` and trigger GitHub Actions deployment. A saved article appears on the website after deployment succeeds. Existing advanced Markdown and MDX use source editing to preserve their syntax; the final rendering is shown on the blog. From 320c242e09b69aaca559f2e7115cc0d629ce99be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A1=B5?= Date: Sun, 8 Nov 2026 20:25:54 +0800 Subject: [PATCH 6/6] fix(cms): publish new articles by default --- MAINTENANCE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTENANCE.md b/MAINTENANCE.md index f13656c..7bde809 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -20,7 +20,7 @@ Song forms can update one existing card without rewriting the rest of the articl The editor preview does not reproduce the complete Astro rendering pipeline. Validate advanced content with the real site build. Do not introduce a parser that silently rewrites custom syntax. -Posts live in `src/content/posts//index.md` or `index.mdx`, with images beside the article. Preserve existing paths. New content defaults to a draft. Local editing writes files without committing or pushing; the online GitHub backend commits to `main`, triggering deployment. +Posts live in `src/content/posts//index.md` or `index.mdx`, with images beside the article. Preserve existing paths. New Markdown and MDX articles in the web CMS default to public (`draft: false`); use the draft switch to save them privately. The `pnpm new-post` CLI still creates drafts, and existing posts retain their saved draft state. Local editing writes files without committing or pushing; the online GitHub backend commits to `main`, triggering deployment. Keep functional article fields in the schema. Unreferenced tags/attribution metadata may remain in historical Markdown, but must not restore the removed tag interface, filtering or hydrated payloads. Interface labels stay in the small English dictionary; runtime language switching is absent.