Skip to content

博客改版:纸质手记风格 + Markdown 写作台 + 自动发布 - #1

Closed
Manuforest wants to merge 1 commit into
mainfrom
feat/journal-redesign-writing-desk
Closed

Manuforest wants to merge 1 commit into
mainfrom
feat/journal-redesign-writing-desk

Conversation

@Manuforest

Copy link
Copy Markdown
Owner

改动

新增米白 / 灰绿的个人手记主题:首页、文章页、归档、标签、关于页、留言板、404 与手机布局;支持明暗主题、全文搜索、文章目录、代码复制、RSS 和站点地图。

新增 /write/ 本机 Markdown 写作台:原稿 / 基础预览、导入、单份 IndexedDB 草稿、粘贴 / 拖入图片、文章与图片 ZIP 导出,以及 GitHub 上传快捷入口。写作台不索取 GitHub Token,也不代替用户执行提交。发布流程为:导出 → 解压 → 上传文章文件夹到 content/posts/ → 提交 → Actions 构建并部署。

原内容保护

保留现有全部文件,不覆盖或改写旧文章 JSON、旧首页或原图。新增构建从 api/articles/*.json 读取仓库内 11 篇旧文章,生成 .html 与目录式旧链接入口。正文做可执行 HTML 清理,保留文字、图片地址和标题锚点。新文章可直接以 Markdown + 图片文件夹维护;旧文尚未批量转换为 Markdown。

_site/ 不输出原 api/site.json、Markdown 源稿或未发布草稿独占的附件。请注意:公开仓库中已提交的 draft: true 文件仍然公开。旧配置已有 Gitalk clientSecret 字段,请到对应 OAuth App 撤销 / 轮换;排除网站输出不能撤销已经公开的凭据。

已完成验证

  • 本地 9 项 Python 内容处理测试全部通过,两个 JavaScript 文件语法检查通过。
  • 离线 Chromium 验证:桌面 / 390px 手机无横向溢出、分类筛选、搜索(本地模拟索引)、主题切换、目录、预览脚本转义、图片插入、ZIP 导出与中文文件名 / CRC 完整性。
  • 本地视觉预览使用 6 篇旧文的少量公开摘录作为排版测试数据;这些测试摘录没有提交到仓库。真实完整内容由本 PR 的 GitHub Actions 构建读取并校验。

尚未验证真实域名下 IndexedDB 刷新恢复、远程图床可用性、原 Twikoo 服务与历史评论匹配、线上部署。PR 的 build 只校验和上传可下载的 journal-preview artifact,不发布线上。

第一次上线

  1. 先查看 PR build 检查,确认后合并。
  2. 仓库 Settings → Pages → Build and deployment → Source 选择 GitHub Actions。
  3. Actions → Build and publish journal,必要时 Run workflow(main)。等待 build / deploy 成功。

详细写作、上传、配置、预览和回退说明已写入 README。现有线上站点在本 PR 合并和切换部署前保持不变。

Preserve existing Hexo exports and legacy routes. Add static Python build,
responsive light/dark theme, search, archives, tags, writing/image ZIP tools,
content validation tests, and opt-in GitHub Pages Actions deployment.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T08:37:00.574344Z f0a629d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f0a629d1c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread blog/build.py
slug = slugify(meta.get("slug", filename_slug))
if slug in posts:
raise ValueError(f"重复 slug: {slug};请改名,旧文章不会被隐式覆盖")
title_match = re.search(r"^#\s+(.+)$", text, re.M)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse Markdown before choosing the title

When a post omits frontmatter title and contains a fenced code line such as # install, this regex treats that line as the article heading, uses it as the title, and removes it from the source before rendering, corrupting both the title and code sample. Derive the title from a parsed top-level heading outside code blocks rather than searching the raw Markdown text.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant