Skip to content

Commit 8899d68

Browse files
authored
add blog index and rss feed (#126)
1 parent a916db7 commit 8899d68

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

blog.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: default
3+
permalink: /blog
4+
---
5+
6+
<div class="blog archive">
7+
8+
<ul class="post-list">
9+
{% for post in site.posts %}
10+
<li>
11+
<h2 class="post-title">
12+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
13+
</h2>
14+
</li>
15+
{% endfor %}
16+
</ul>
17+
18+
</div>

rss.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
layout: null
3+
permalink: /rss
4+
---
5+
<?xml version="1.0" encoding="UTF-8"?>
6+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
7+
<channel>
8+
<title>{{ site.title | xml_escape }}</title>
9+
<description>{{ site.description | xml_escape }}</description>
10+
<link>{{ site.url }}{{ site.baseurl }}/</link>
11+
<atom:link href="{{ site.rss | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml"/>
12+
<pubDate>{{ site.time | date_to_rfc822 }}</pubDate>
13+
<lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
14+
<generator>Jekyll v{{ jekyll.version }}</generator>
15+
{% for post in site.posts limit:10 %}
16+
<item>
17+
<title>{{ post.title | xml_escape }}</title>
18+
<description>{{ post.content | xml_escape }}</description>
19+
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
20+
<link>{{ post.url | prepend: site.baseurl | prepend: site.url }}</link>
21+
<guid isPermaLink="true">{{ post.url | prepend: site.baseurl | prepend: site.url }}</guid>
22+
{% for tag in post.tags %}
23+
<category>{{ tag | xml_escape }}</category>
24+
{% endfor %}
25+
{% for cat in post.categories %}
26+
<category>{{ cat | xml_escape }}</category>
27+
{% endfor %}
28+
</item>
29+
{% endfor %}
30+
</channel>
31+
</rss>

0 commit comments

Comments
 (0)