在 Octopress RSS 中仅显示 headers
Show only headers in Octopress RSS
我有一个基于 Octopress 的博客。它生成一个 RSS
-feed,但该 feed 包含包含图像的整个页面(帖子)。
我怎样才能 "shrink" 让它只包含 headers 页(帖子)?
Octopress: 2.0
杰基尔: 2.0.3
在 feed.xml 中,可以使用 post.excerpt
.
而不是 post.content
两种解决方案:
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 }}
我有一个基于 Octopress 的博客。它生成一个 RSS
-feed,但该 feed 包含包含图像的整个页面(帖子)。
我怎样才能 "shrink" 让它只包含 headers 页(帖子)?
Octopress: 2.0
杰基尔: 2.0.3
在 feed.xml 中,可以使用 post.excerpt
.
post.content
两种解决方案:
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 }}