Skip to content

Commit 4b5a2a8

Browse files
authored
Merge pull request #398 from alexandru/rss-feed2
Fix #392: Add blog/feed.rss
2 parents 303afdd + e07fec6 commit 4b5a2a8

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

_includes/_head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
1515
<link rel="stylesheet" href="{{ '/css/main.css' | relative_url }}">
1616

17+
<link rel="alternate" type="application/rss+xml" title="Blog articles" href="{% link blog/feed.rss %}" />
1718

1819
</head>

blog/feed.rss

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
layout: empty
3+
---
4+
<?xml version="1.0" encoding="UTF-8"?>
5+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
6+
<channel>
7+
<title>{{ site.name | xml_escape }}</title>
8+
<description>{% if site.description %}{{ site.description | xml_escape }}{% endif %}</description>
9+
<link>{{ site.baseurl }}</link>
10+
<copyright>CC BY 3.0</copyright>
11+
{% for post in site.posts %}
12+
<item>
13+
<title>{{ post.title | xml_escape }}</title>
14+
{% if post.meta.author %}
15+
<dc:creator>{{ post.meta.author | xml_escape }}</dc:creator>
16+
{% endif %}
17+
<description>
18+
<![CDATA[{{ post.content }}]]>
19+
</description>
20+
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
21+
<link>{{ site.baseurl }}{{ post.url }}</link>
22+
<guid isPermaLink="true">{{ site.baseurl }}{{ post.url }}</guid>
23+
</item>
24+
{% endfor %}
25+
</channel>
26+
</rss>

0 commit comments

Comments
 (0)