Skip to content

[建议] 同时输出 Atom 和 RSS 2.0 格式 #38

@gitfox-enter

Description

@gitfox-enter

现状

当前只生成 Atom 格式的 feed。虽然 Atom 是更现代的格式,但部分旧版阅读器和工具只支持 RSS 2.0。

改进方案

方案 A:双格式输出

为每个站点同时生成:

  • feeds/xian-bao-ku.xml(Atom,主格式)
  • feeds/xian-bao-ku.rss(RSS 2.0,兼容格式)

<link> 中添加互相引用:

<!-- Atom feed 中 -->
<link rel="alternate" type="application/rss+xml" href="...xian-bao-ku.rss" />

<!-- RSS feed 中 -->
<atom:link rel="alternate" type="application/atom+xml" href="...xian-bao-ku.xml" />

方案 B:内容协商(推荐)

使用 Cloudflare Worker 根据 Accept 请求头返回对应格式:

  • Accept: application/atom+xml → 返回 Atom
  • Accept: application/rss+xml → 返回 RSS 2.0
  • 默认返回 Atom

预期效果

  • 兼容所有 RSS 阅读器
  • OPML 中可以提供两种格式选择

复杂度

中等。RSS 2.0 格式转换约 100 行代码。

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions