Skip to content

Instantly share code, notes, and snippets.

@Frenchcooc
Forked from stammy/index.xml
Last active June 27, 2022 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Frenchcooc/f0a3cdd69383420f17f08bf9d231afa3 to your computer and use it in GitHub Desktop.
Save Frenchcooc/f0a3cdd69383420f17f08bf9d231afa3 to your computer and use it in GitHub Desktop.
RSS Feed Generator for Jekyll (feed.rss)
---
layout: null
title: "Feed title (e.g. John Doe's Blog)"
author: "Site name (e.g. John Doe)"
website: "http://example.org"
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text" xml:lang="en">{{ page.title }}</title>
<link type="application/atom+xml" href="{{ page.website }}/feed.rss" rel="self"/>
<link type="text" href="{{ page.website }}" rel="alternate"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ page.website }}</id>
<author>
<name>{{ page.author }}</name>
</author>
<rights>Copyright © {{ 'now' | date: "%Y" }} {{ page.author }}</rights>
{% for post in site.posts limit:20 %}
<entry>
<title>{{ post.title | xml_escape }}</title>
<link href="{{ website }}{{ post.url }}"/>
<updated>{{ post.date | date_to_xmlschema }}</updated>
<id>{{ page.website }}{{ post.id }}</id>
<content type="html">{{ post.content | xml_escape }}</content>
</entry>
{% endfor %}
</feed>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment