我有一个基于 Octopress 的博客。它生成一个 RSS
-feed,但该 feed 包含包含图像的整个页面(帖子)。
如何“缩小”它,使其仅包含页面(帖子)的标题?
Octopress:2.0
杰基尔:2.0.3
最佳答案
在 feed.xml 中,不要使用 post.content
,您可以使用post.excerpt
.
两种解决方案:
1 - 使用 octopress 设置
添加<!-- more -->
在您的帖子中标记 post.excerpt
之间的限制和post.content
。 content
仍然包含两者。
2 - 使用 Jekyll 默认
删除此行 excerpt_separator: <!--more-->
从你的配置文件。由于默认摘录分隔符是 "\n\n"
(两行新行)摘录将自动创建。
替代解决方案
使用truncate过滤{{ post.content | truncate: 200 | expand_urls: site.url | cdata_escape }}
关于rss - 在 Octopress RSS 中仅显示标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30741560/