Skip to content

Commit 7f7321c

Browse files
committed
Enable RSS feed for blog
1 parent 7e4905b commit 7f7321c

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

_includes/head.html

+2
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@
1313
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
1414

1515
<link rel="canonical" href="{{ site.url }}{{ page.url }}">
16+
17+
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed.xml" />
1618
</head>

feed.xml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
layout: null
3+
---
4+
<?xml version="1.0" encoding="UTF-8"?>
5+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
6+
<channel>
7+
<title>{{ site.name }}</title>
8+
<description>{{ site.description }}</description>
9+
<link>{{ site.url }}</link>
10+
<atom:link href="{{ site.url }}/feed.xml" rel="self" type="application/rss+xml" />
11+
{% for post in site.posts limit:10 %}
12+
<item>
13+
<title>{{ post.title }}</title>
14+
<description>{{ post.content | xml_escape }}</description>
15+
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
16+
<link>{{ site.url }}{{ post.url }}</link>
17+
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
18+
</item>
19+
{% endfor %}
20+
</channel>
21+
</rss>

0 commit comments

Comments
 (0)