Skip to content

Instantly share code, notes, and snippets.

@Nooshu
Created January 28, 2025 23:18
Show Gist options
  • Save Nooshu/da04fd0322e45936fbbc5c663ebc9677 to your computer and use it in GitHub Desktop.
Save Nooshu/da04fd0322e45936fbbc5c663ebc9677 to your computer and use it in GitHub Desktop.
The Nunjucks template I use to output my plaintext RSS feed in 11ty 3.0.0
---
permalink: feed/feed.txt
eleventyComputed:
layout: null
---
# {{ metadata.title }} - {{ metadata.author.name }} - {{ metadata.description }}
## {{ metadata.fulldescription }}
URL: {{ metadata.url }}
{% for post in collections.posts | reverse -%}
{% if loop.index0 < 10 -%}
--- Start: {{ post.data.title | safe }}
Published on: {{ post.date | readableDate }}
{{ metadata.url }}{{ post.url }}
Main Content:
{{ post.templateContent | striptags(true) | decodeHtmlEntities | safe }}
{% if not loop.last %}
--- End: {{ post.data.title | safe }}
{% endif -%}
{% endif -%}
{% endfor -%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment