将 Obsidian 笔记一键发布到任意 GitHub 仓库托管的博客。
基于 Obsidian Digital Garden 修改。
Blog Publisher 让你直接在 Obsidian 里把笔记发布到 GitHub 仓库。你在笔记的 frontmatter 里加上 pub-blog: true,运行发布命令,笔记就会推送到你配置的仓库中。如果你的博客仓库配了 GitHub Actions 自动部署,push 之后博客会自动更新。
适合已经用 GitHub Pages / Vercel / Netlify 等方案托管博客的人——你的 Obsidian 笔记库就是博客的内容源。
发布方式
pub-blog: true 的笔记内容支持
[[链接]])![[嵌入]])==高亮==)图片处理
Frontmatter 处理
title、description、publishDate 等)permalink 并写入 frontmatterblog-path 字段(笔记在博客仓库中的路径)状态跟踪(可选启用)
pub-blog: true 基础上,用 status 字段控制发布中心的状态分类status: ongoing(可配置)→ 发布中心检查远程内容,判断是未发布还是有改动status: done(可配置)→ 跳过检查,直接显示为已发布🟡 Ongoing / 🟢 Done)隐私控制
pub-blog: true 的笔记才会被发布第一步:创建 GitHub Token
Contents → Read and write(必需,用于读写文件)Actions → Read and write(可选,如果需要触发部署工作流)第二步:安装插件并配置
第三步:发布第一篇笔记
pub-blog: true:---
pub-blog: true
title: 我的第一篇博客
---
Ctrl/Cmd + P),运行 "Blog Publisher: 发布当前笔记"设置页分为三个部分:GitHub 仓库设置、路径改写、高级。
这部分配置你的 GitHub 仓库连接信息。填写完成后会自动检查连接状态。
| 设置项 | 说明 | 示例 |
|---|---|---|
| 仓库名称 | 你的博客仓库名称(不含用户名前缀) | myblog |
| GitHub 用户名 | 你的 GitHub 用户名 | joeytoday |
| GitHub Token | 具有仓库读写权限的 Token(输入框已做密码遮挡) | github_pat_xxxx... |
| 内容发布路径 | 笔记在仓库中的存放路径,末尾会自动补 / |
src/content/(默认) |
| 图片上传路径 | 图片在仓库中的存放路径,末尾会自动补 / |
src/site/img/user/(默认) |
| 图片 URL 前缀 | 发布后 Markdown 中图片链接的前缀 | /img/user/(默认) |
路径说明:假设你的笔记叫 weekly-01.md,内容发布路径设为 src/content/,发布后文件会出现在仓库的 src/content/weekly-01.md。图片同理,如果你在笔记里引用了 ![[screenshot.png]],图片会上传到 src/site/img/user/screenshot.png,发布后的 Markdown 中图片链接变成 。
路径改写规则让你把 Obsidian 中的文件夹结构映射到博客仓库中的不同结构。
| 设置项 | 说明 |
|---|---|
| 路径改写规则 | 每行一条规则,格式为 原始路径:目标路径 |
示例:
假设你的 Obsidian 笔记库结构是 PARA 体系,博客想按主题组织:
1-projects/blog/:blog/
1-projects/worknotes/:worknotes/
notes/PARA系统.md:notes/PARA系统.md
效果:
1-projects/blog/2026/weekly-01.md → 发布到 blog/2026/weekly-01.md1-projects/worknotes/2026/note.md → 发布到 worknotes/2026/note.md提示:留空目标路径(如 old-folder:)表示映射到仓库根目录。
状态跟踪让你用 frontmatter 中的状态字段控制发布中心的状态分类。在 pub-blog: true 的基础上,状态字段决定发布中心是否检查远程内容。
核心场景:做了一些小修改(比如改个错别字),不想重新发布。把状态改为已发布值,发布中心就不会再提示有改动。
| 设置项 | 说明 | 默认值 |
|---|---|---|
| 启用状态跟踪 | 开关。启用后用可配置的状态值替代硬编码的 🟡 Ongoing / 🟢 Done |
关闭 |
| 状态属性名 | 用于状态跟踪的 frontmatter 属性名 | status |
| 待发布状态值 | 状态为此值时,发布中心检查远程内容,判断是未发布还是有改动 | ongoing |
| 已发布状态值 | 状态为此值时,跳过远程检查,直接显示为已发布 | done |
frontmatter 写法(默认属性名 status):
---
pub-blog: true
status: ongoing # 发布中心会检查是否有改动
---
---
pub-blog: true
status: done # 跳过检查,显示为已发布,小修改不触发重新发布
---
如果自定义属性名(比如改为 publish-state):
---
pub-blog: true
publish-state: ongoing
---
pub-blog: true 始终是发布的前提。状态字段只影响发布中心的状态分类,不影响发布命令的执行。
未启用时,发布中心使用硬编码的 status 属性、🟡 Ongoing / 🟢 Done 值判断状态,行为与之前一致。
| 设置项 | 说明 |
|---|---|
| 启用调试日志 | 开启后在开发者控制台(Ctrl/Cmd + Shift + I)显示详细日志,用于排查问题。日常使用不需要开启 |
| 命令 | 说明 |
|---|---|
| 快速发布并分享 | 自动添加 pub-blog: true 标记,发布笔记,然后把笔记 URL 复制到剪贴板 |
| 发布当前笔记 | 发布当前打开的笔记 |
| 发布所有标记的笔记 | 批量发布所有 pub-blog: true 的笔记,同时删除已取消标记的笔记和图片 |
| 复制笔记 URL | 把已发布笔记的 URL 复制到剪贴板 |
| 打开发布中心 | 打开可视化发布管理界面 |
| 添加发布标记 | 在当前笔记 frontmatter 中添加 pub-blog: true |
| 移除发布标记 | 从当前笔记 frontmatter 中移除 pub-blog |
| 切换发布状态 | 切换 pub-blog 的开/关状态 |
发布中心是一个可视化界面,让你集中管理发布状态:
pub-blog: true 但尚未发布的笔记点击左侧栏的图标或运行"打开发布中心"命令即可打开。
整个发布流程:
pub-blog: trueon: push 的 GitHub Actions 工作流,push 后自动触发部署不需要单独配置部署触发——git push 本身就会触发仓库的 on: push 工作流。
Blog Publisher lets you publish Obsidian notes directly to a GitHub repository. Add pub-blog: true to a note's frontmatter, run the publish command, and the note is pushed to your configured repo. If your blog repo has a GitHub Actions deployment workflow, the blog updates automatically on push.
Ideal for anyone already using GitHub Pages / Vercel / Netlify — your Obsidian vault becomes the content source for your blog.
Publishing
pub-blog: true at onceContent Support
[[wikilinks]])![[embed]])==highlight==)Image Handling
Frontmatter Handling
title, description, publishDate, etc.)blog-path field is auto-written (the note's path in the blog repo)Status Tracking (optional)
pub-blog: true — uses the status frontmatter field to control Publication Center categorizationstatus: ongoing (configurable) → Publication Center checks remote content, shows as unpublished or changedstatus: done (configurable) → skips remote check, shows as published directly🟡 Ongoing / 🟢 Done) are usedPrivacy
pub-blog: true are publishedon: pushStep 1: Create a GitHub Access Token
Contents → Read and write (required)Actions → Read and write (optional, if triggering deploy workflows)Step 2: Install and configure the plugin
Step 3: Publish your first note
pub-blog: true to the note's frontmatter:---
pub-blog: true
title: My First Post
---
Ctrl/Cmd + P) and run "Blog Publisher: Publish current note"The settings page has three sections: GitHub Repository, Path Rewriting, and Advanced.
These configure your GitHub repository connection. Connection status is checked automatically as you type.
| Setting | Description | Example |
|---|---|---|
| Repository name | Your blog repo name (without username prefix) | myblog |
| GitHub username | Your GitHub username | joeytoday |
| GitHub Token | A token with repo read/write access (input is masked) | github_pat_xxxx... |
| Content path | Where notes are stored in the repo (trailing / auto-added) |
src/content/ (default) |
| Image upload path | Where images are stored in the repo (trailing / auto-added) |
src/site/img/user/ (default) |
| Image URL prefix | URL prefix for image links in published Markdown | /img/user/ (default) |
How paths work: If your note is weekly-01.md and the content path is src/content/, the file will appear at src/content/weekly-01.md in the repo. Images work the same way — ![[screenshot.png]] in a note gets uploaded to src/site/img/user/screenshot.png, and the published Markdown references it as .
Path rewrite rules let you map your Obsidian folder structure to a different structure in the blog repo.
| Setting | Description |
|---|---|
| Path rewrite rules | One rule per line, format: source-path:target-path |
Example:
If your vault uses a PARA structure but your blog organizes by topic:
1-projects/blog/:blog/
1-projects/worknotes/:worknotes/
notes/PARA系统.md:notes/PARA系统.md
Result:
1-projects/blog/2026/weekly-01.md → published to blog/2026/weekly-01.md1-projects/worknotes/2026/note.md → published to worknotes/2026/note.mdTip: Leave the target path empty (e.g., old-folder:) to map to the repo root.
Status tracking lets you use a frontmatter status field to control how the Publication Center categorizes notes. On top of pub-blog: true, the status field determines whether the Publication Center checks remote content.
Core use case: made a minor edit (e.g., fixed a typo) and don't want to re-publish. Set the status to the published value, and the Publication Center won't flag it as changed.
| Setting | Description | Default |
|---|---|---|
| Enable status tracking | Toggle. When on, uses configurable status values instead of hardcoded 🟡 Ongoing / 🟢 Done |
Off |
| Status field name | The frontmatter property name used for status tracking | status |
| Track status value | Notes with this status value are checked against remote content for changes | ongoing |
| Published status value | Notes with this status value skip the remote check and show as published | done |
Frontmatter usage (default field name status):
---
pub-blog: true
status: ongoing # Publication Center checks for changes
---
---
pub-blog: true
status: done # Skips check, shows as published — minor edits won't trigger re-publish
---
With a custom field name (e.g., publish-state):
---
pub-blog: true
publish-state: ongoing
---
pub-blog: true is always required. The status field only affects Publication Center categorization, not the publish commands themselves.
When disabled, the Publication Center uses the hardcoded status field with 🟡 Ongoing / 🟢 Done values, same as before.
| Setting | Description |
|---|---|
| Enable debug logging | Shows detailed logs in the developer console (Ctrl/Cmd + Shift + I). Not needed for daily use |
| Command | Description |
|---|---|
| Quick publish and share | Adds pub-blog: true, publishes the note, and copies its URL to clipboard |
| Publish current note | Publishes the active note |
| Publish all marked notes | Batch publishes all notes with pub-blog: true; also removes deleted notes and images from the repo |
| Copy note URL | Copies the published note's URL to clipboard |
| Open Publication Center | Opens the visual publication management view |
| Add publish mark | Adds pub-blog: true to the current note's frontmatter |
| Remove publish mark | Removes pub-blog from the current note's frontmatter |
| Toggle publish status | Toggles pub-blog on/off |
The Publication Center is a visual dashboard for managing your publishing status:
pub-blog: true but not yet publishedOpen it via the ribbon icon or the "Open Publication Center" command.
The full flow:
pub-blog: true in frontmatteron: push GitHub Actions workflow, deployment triggers automaticallyNo separate deploy trigger setting is needed — git push itself triggers the repo's on: push workflow.
MIT License