-
I've create xml file and it just copy pasted into the output. This my file: ---
layout: null
permalink: /blog/rss.xml
eleventyExcludeFromCollections: true
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Jakub Jankiewicz Blog</title>
<link>https://jakub.jankiewicz.org/blog/</link>
<description>Personal blog of Jakub Jankiewicz</description>
<lastBuildDate>{{ site.date | date: "%a, %d %b %Y %H:%M:%S %Z" }}</lastBuildDate>
{% for post in collections.posts %}
<item>
<title>{{ post.data.title }}</title>
<link>{{ post.url }}</link>
<description>{{ post.templateContent | xml_escape }}</description>
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %Z" }}</pubDate>
<dc:creator>{{ metadata.author.name }}</dc:creator>
<guid isPermaLink="true">{{ post.url }}</guid>
</item>
{% endfor %}
</channel>
</rss> I can't find information where I should add extensions that are processed by eleventy. I tried what is in documentation: https://www.11ty.dev/docs/plugins/rss/ I've tried what chatGPT was suggesting: eleventyConfig.addTemplateFormats("xml"); but then no output file is generated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
So I was able to solve it, I'm not sure if this is in documentation but you can't use xml extension with Eleventy like with Jekyll. You need liquid extension and use permalink to copy to the output. The documentation in RSS say to name the file njk, but I think that this should be big warning. |
Beta Was this translation helpful? Give feedback.
So I was able to solve it, I'm not sure if this is in documentation but you can't use xml extension with Eleventy like with Jekyll. You need liquid extension and use permalink to copy to the output.
The documentation in RSS say to name the file njk, but I think that this should be big warning.