跳转至

mkdocs RSS / Atom Feed

目的:为文档加 RSS / Atom feed 关联:[B1-6]


1. 插件

mkdocs-material 自带 RSS 支持: - material/feed plugin


2. 3 步配置

2.1 Step 1: 配置

# mkdocs.yml
plugins:
  - feed:
      # 输出位置
      feed_url: feed_rss_updated.xml
      match_path: ".*"  # 哪些 path 进 feed
      date_format: "%Y-%m-%d"

5 行

2.2 Step 2: frontmatter

---
title: Post title
date: 2026-06-01
description: Brief summary
---

# Content

date + description 必填

2.3 Step 3: 输出

/feed_rss_updated.xml —— 用户订阅。


3. 5 个 feed 类型

Type 用途
RSS 2.0 老标准
Atom 1.0 新标准
JSON Feed 程序员友好
RSS updated 最近修改
RSS full 全部

5 类型


4. 5 个最佳实践

  1. 最近 N 篇 —— 不要全量
  2. 含 description —— 摘要
  3. 含 date —— 时间戳
  4. 含 author —— 归属
  5. HTML 净化 —— 安全

5. 总结

RSS = feed plugin + 3 步配置 + 5 类型

下一步: - 看 B1-7 social links