I'm moving a blog to Jekyll, and I'd like to offer an RSS feed. I need to exclude some javascript-dependent features, e.g. slideshows, from the RSS content. Is there any way to tell a post (or an {% include %}
in the post) whether it's being inserted into the index.html
file or the feed.xml
file?
With much simplification, here's how I'd like it to look:
index.html
---
layout: page
title: Index
include_slideshow: true
---
{% for post in paginator.posts %}
{{ post.content }}
{% endfor %}
feed.xml
---
layout: nil
include_slideshow: false
---
{% for post in site.posts limit:10 %}
{{ post.content }}
{% endfor %}
_posts/2013-10-01-random-post.html
---
layout: post
title: Random Post
---
This is a random post.
{% if include_slideshow %}
INSERT SLIDESHOW HERE.
{% else %}
NOTHING TO SEE HERE, MOVE ALONG.
{% endif %}
The problem is that the include_slideshow
variable from the YAML front matter of index.html and feed.xml is not available to _posts/2013-10-01-random-post.html. Is there a different way to accomplish this?
I'm deploying via GitHub pages, so Jekyll extensions are not an option.