Skip to content

Commit 7d06706

Browse files
author
root
committed
add support for RSS link in the footer
1 parent c4bd663 commit 7d06706

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,17 @@ author:
203203

204204
Remove the lines that you don't want to display in the footer, and change `yourname` to the correct values in the links you want to keep.
205205

206+
#### Add an RSS feed link to the footer
207+
208+
You can add an icon that will link to an RSS feed of your blog by including the following parameter in `_config.yml`:
209+
210+
```yaml
211+
rss-footer: true
212+
```
213+
206214
#### Add your website's name to the footer
207215

208-
After all the contact info links, you can also add the name of your website by defining the` url-pretty` parameter in `_config.yml`:
216+
After all the contact info links, you can also add the name of your website by defining the `url-pretty` parameter in `_config.yml`:
209217

210218
```yaml
211219
url-pretty: "MyWebsite.com"

_includes/footer.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@
143143
</a>
144144
</li>
145145
{% endif %}
146+
{% if site.rss-footer %}
147+
<li>
148+
<a href="/feed.xml" title="RSS">
149+
<span class="fa-stack fa-lg">
150+
<i class="fa fa-circle fa-stack-2x"></i>
151+
<i class="fa fa-rss fa-stack-1x fa-inverse"></i>
152+
</span>
153+
</a>
154+
</li>
155+
{% endif %}
146156
</ul>
147157
<p class="copyright text-muted">
148158
{% if site.author.name %}

feed.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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.title | xml_escape }}</title>
8+
<description>{{ site.description | xml_escape }}</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:20 %}
12+
<item>
13+
<title>{{ post.title | xml_escape }}</title>
14+
<description>
15+
{% if post.subtitle %}{{ post.subtitle | xml_escape }} - {% endif %}
16+
{{ post.content | strip_html | xml_escape | truncatewords: 50 }}
17+
</description>
18+
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
19+
<link>{{ site.url }}{{ post.url }}</link>
20+
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
21+
</item>
22+
{% endfor %}
23+
</channel>
24+
</rss>

0 commit comments

Comments
 (0)