Skip to content

Instantly share code, notes, and snippets.

@tcelestino
Last active November 18, 2025 14:35
Show Gist options
  • Select an option

  • Save tcelestino/c63389b8713637252f44714109486bfc to your computer and use it in GitHub Desktop.

Select an option

Save tcelestino/c63389b8713637252f44714109486bfc to your computer and use it in GitHub Desktop.
---json
{
"permalink": "feed.xml",
"eleventyExcludeFromCollections": true,
"metadata": {
"title": "Titulo do seu blog",
"description": "Descrição do seu blog",
"language": "pt-BR",
"base": "https://seu-blog.com/",
"author": {
"name": "Seu nome"
}
}
}
---
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:base="{{ metadata.base | addPathPrefixToFullUrl }}" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ metadata.title }}</title>
<link>{{ metadata.base | addPathPrefixToFullUrl }}</link>
<atom:link href="{{ permalink | htmlBaseUrl(metadata.base) }}" rel="self" type="application/rss+xml" />
<description>{{ metadata.description }}</description>
<language>{{ metadata.language or page.lang }}</language>
{%- for post in collections.posts | reverse %}
{%- set absolutePostUrl = post.url | htmlBaseUrl(metadata.base) %}
<item>
<title>{{ post.data.title }}</title>
<link>{{ absolutePostUrl }}</link>
<description>{{ post.content | renderTransforms(post.data.page, metadata.base) }}</description>
<pubDate>{{ post.date }}</pubDate>
<dc:creator>{{ metadata.author.name }}</dc:creator>
<guid>{{ absolutePostUrl }}</guid>
</item>
{%- endfor %}
</channel>
</rss>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment