那些使用静态网站生成器,搭建自己的 blog 的朋友,我很感激你们在 blog 里添加了 RSS 订阅功能,但我仍然希望你们能够进一步,把 RSS 改成输入全文,而不是只显示摘要。

很多人应该并没有意识到这一点,也不知道如何配置。没关系。

以 Hugo 为例,在内置模板或主题的 index.rss.xml 中:

<description>{{ .Summary | html }}</description>

把 .Summary 改成 .Content 就可以乐!

以及,Hugo 默认在 RSS 里输出所有文章,如果你以后写了成百上千篇 blog,RSS 文件可能过于庞大。只需把模板第一行改成

{{ range first 20 .Data.Pages }}

显示前 20 篇,就可以乐!

谢谢。

@fivestone 实在不行可以用 fivefilter 转换一下只输出摘要的 feed

Follow

@seanmiona 为什么最近这么多叫 five... 的工具站?我表示惶恐了……

· · Web · 1 · 0 · 0

@fivestone 它以前叫 fivefilter, 现在叫啥我忘了hhh 用了七八年了?运行很稳定

Sign in to participate in the conversation
Fivediverse

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!