Show only headers in Octopress RSS

94 views Asked by At

I have a blog based on Octopress. It generates an RSS-feed, but that feed contains whole pages (posts) with images included.

How can I "shrink" it, so it would contain only headers of pages (posts)?

Octopress: 2.0
Jekyll: 2.0.3

1

There are 1 answers

6
David Jacquel On BEST ANSWER

In feed.xml, instead of using post.content, you can use post.excerpt.

Two solutions :

1 - Using octopress setup

Add a <!-- more --> in your posts to mark the limit between post.excerpt and post.content. content still contains both.

2 - Using Jekyll default

Remove this line excerpt_separator: <!--more--> from your config file. As the default excerpt separator is "\n\n" (two new lines) excerpt will be created autoamtically.

Alternative solution

Use the truncate filter {{ post.content | truncate: 200 | expand_urls: site.url | cdata_escape }}

You will find more information about excerpt in Jekyll documentation