Content Publisher Pro

👤 wdsega 📦 v1.1.0 ⭐ 4.2 ⬇️ 581 下載
✍️ 內容創作 免費 🔑 需 API Key

📖 技能介紹


name: "content-publisher-pro" version: "1.1.0" title: "Content Publisher Pro" description: "一鍵將文章釋出到 GitHub Pages 部落格和 Dev.to 開發者社群,支援內容差異化、SEO最佳化、釋出前去重檢查。適合技術博主和內容運營者。" author: "WDSEGA" type: "workflow" category: "productivity" tags: ["content", "publishing", "blog", "devto", "github-pages", "automation", "seo"] difficulty: "intermediate" price: "19.99" license: "MIT"


Content Publisher Pro

功能概述

一套內容多平臺釋出工具,幫助技術博主將 Markdown 文章快速釋出到 GitHub Pages 部落格和 Dev.to 開發者社群,同時提供 SEO 最佳化和釋出前去重檢查。

核心功能

1. 多平臺釋出

  • GitHub Pages (Jekyll 部落格) - 釋出完整版文章
  • Dev.to (開發者社群) - 釋出文章並自動檢查重複

2. 內容差異化

  • 完整版 (100%) - 釋出到 GitHub Pages 部落格
  • 精簡版 (70%) - 自動擷取正文前 70%,附加引流連結
  • 摘要版 (30%) - 生成簡短摘要,適合社交平臺分享

3. SEO 最佳化

  • 自動生成 meta description(160 字元以內)
  • 智慧提取關鍵詞(基於詞頻統計)
  • 標題長度最佳化(建議 30-60 字元)
  • 生成 Open Graph 標籤

4. 釋出前去重

  • Dev.to 平臺:釋出前自動檢查已有文章標題,防止重複釋出
  • GitHub Pages:提供 check_duplicate 方法可手動呼叫檢查

使用前提

必需配置

複製 config.yaml.exampleconfig.yaml,填入你的 API 金鑰:

github:
  token: "ghp_xxxxxxxxxxxx"       # GitHub Personal Access Token
  repo: "username.github.io"       # 部落格倉庫名 (格式: 使用者名稱/倉庫名)

devto:
  api_key: "xxxxxxxxxx"            # Dev.to API Key

獲取 API 金鑰: - GitHub Token: https://github.com/settings/tokens - Dev.to API Key: https://dev.to/settings/account

安裝依賴

pip install -r requirements.txt

使用方法

釋出單篇文章

python publish.py --article ./article.md

預覽模式(不實際釋出)

python publish.py --article ./article.md --dry-run

指定平臺

# 僅釋出到部落格
python publish.py --article ./article.md --platforms blog

# 僅釋出到 Dev.to
python publish.py --article ./article.md --platforms devto

# 同時釋出到兩個平臺
python publish.py --article ./article.md --platforms all

指定配置檔案

python publish.py --config /path/to/config.yaml --article ./article.md

命令列引數

python publish.py [選項]

必需引數:
  --article, -a    文章檔案路徑

可選引數:
  --config, -c     配置檔案路徑 (預設: config.yaml)
  --platforms, -p  釋出平臺: all / blog / devto (預設: all)
  --mode, -m       釋出模式: full / summary / abstract / auto (預設: auto)
  --dry-run, -d    預覽模式,不實際釋出
  --verbose, -v    詳細輸出

文章格式

建立 Markdown 檔案,包含 YAML front matter:

---
title: "文章標題"
date: 2026-05-23
tags: ["技術", "AI", "教程"]
cover_image: "./assets/cover.jpg"
---

文章正文內容...

支援的 front matter 欄位:

欄位 必需 說明
title 文章標題
date 釋出日期(預設為當前日期)
tags 標籤列表
cover_image 封面圖片路徑
excerpt 自定義摘要(不填則自動提取前 200 字)

檔案結構

content-publisher/
├── SKILL.md                  # 技能描述檔案
├── README.md                 # 使用文件
├── LICENSE                   # MIT 許可協議
├── publish.py                # 主程式入口
├── config.yaml.example       # 配置檔案示例
├── requirements.txt          # Python 依賴
├── utils/
│   ├── __init__.py
│   ├── github_publisher.py   # GitHub Pages 釋出模組
│   ├── devto_publisher.py    # Dev.to 釋出模組
│   ├── content_processor.py  # 內容解析與差異化處理
│   └── seo_optimizer.py      # SEO 最佳化模組
├── templates/
│   ├── blog_template.md      # 部落格文章模板
│   └── devto_template.md     # Dev.to 文章模板
└── examples/
    ├── sample-article.md     # 示例文章
    └── sample-config.yaml    # 示例配置

高階功能

小蔥技能7w4.net有完整的技能分類。

自定義內容模板

編輯 templates/ 目錄下的模板檔案,自定義各平臺釋出格式。

定時釋出

使用系統定時任務(cron):

# 每天上午 9 點自動釋出
0 9 * * * cd /path/to/content && python publish.py --article ./today.md

批次釋出

# 釋出目錄下所有 Markdown 文章
for file in ./articles/*.md; do
  python publish.py --article "$file"
done

注意事項

  1. API 限制: 各平臺有頻率限制,請合理控制釋出頻率
  2. 內容原創: 確保釋出內容原創或已獲得授權
  3. 隱私保護: 不要將 config.yaml 提交到公共倉庫(已在 .gitignore 中忽略)
  4. 錯誤處理: 網路異常時會輸出錯誤資訊,請檢查網路連線和 API 金鑰

故障排除

釋出失敗

  • 檢查 API Token 是否過期
  • 確認網路連線正常
  • 使用 --verbose 檢視詳細錯誤資訊

內容格式錯誤

  • 確保 Markdown 檔案格式正確
  • 檢查 YAML front matter 語法
  • 使用 --dry-run 預覽釋出內容

更新日誌

v1.1.0 (2026-05-23)

  • 修正文件,移除未實現平臺(掘金、知乎、公眾號)的描述
  • 移除未實現的"智慧去重"功能描述(Dev.to 內建去重保留)
  • 統一命令列引數文件與程式碼實現
  • 新增 LICENSE、templates/、examples/

v1.0.0 (2026-05-23)

  • 初始版本釋出
  • 支援 GitHub Pages 和 Dev.to 雙平臺釋出
  • 內容差異化處理(完整版/精簡版/摘要版)
  • SEO 自動最佳化

許可協議

MIT License - 詳見 LICENSE 檔案

🤖 AI 評測

整體質量較好,功能實用且文件詳細,SEO 最佳化和內容差異化等特色功能很有價值。模組化設計清晰,示例充足便於理解使用。主要不足是配置稍顯複雜,中文處理能力有限,且文件中有小部分資訊與實際檔案不一致。適合有技術背景的內容創作者使用。

📊 多維度評分

適應性4.2
規範性4
有效性4.2
可靠性4.3
可信度4.5

📁 包含檔案 (15 個)

📄 LICENSE 1 KB
📄 README.md 1.5 KB
📄 SKILL.md 5.9 KB
📄 _meta.json 140 B
📄 examples/sample-article.md 1 KB
📄 examples/sample-config.yaml 231 B
📄 publish.py 4.7 KB
📄 requirements.txt 45 B
📄 templates/blog_template.md 275 B
📄 templates/devto_template.md 152 B
📄 utils/__init__.py 24 B
📄 utils/content_processor.py 2.4 KB
📄 utils/devto_publisher.py 2.7 KB
📄 utils/github_publisher.py 4.1 KB
📄 utils/seo_optimizer.py 2.6 KB