Browse Source

add support for RSS link in the footer

gem
root 8 years ago
parent
commit
7d0670683c
3 changed files with 43 additions and 1 deletions
  1. +9
    -1
      README.md
  2. +10
    -0
      _includes/footer.html
  3. +24
    -0
      feed.xml

+ 9
- 1
README.md View File

@ -203,9 +203,17 @@ author:
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.
#### Add an RSS feed link to the footer
You can add an icon that will link to an RSS feed of your blog by including the following parameter in `_config.yml`:
```yaml
rss-footer: true
```
#### Add your website's name to the footer
After all the contact info links, you can also add the name of your website by defining the` url-pretty` parameter in `_config.yml`:
After all the contact info links, you can also add the name of your website by defining the `url-pretty` parameter in `_config.yml`:
```yaml
url-pretty: "MyWebsite.com"


+ 10
- 0
_includes/footer.html View File

@ -143,6 +143,16 @@
</a>
</li>
{% endif %}
{% if site.rss-footer %}
<li>
<a href="/feed.xml" title="RSS">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-rss fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
{% endif %}
</ul>
<p class="copyright text-muted">
{% if site.author.name %}


+ 24
- 0
feed.xml View File

@ -0,0 +1,24 @@
---
layout: null
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ site.title | xml_escape }}</title>
<description>{{ site.description | xml_escape }}</description>
<link>{{ site.url }}</link>
<atom:link href="{{ site.url }}/feed.xml" rel="self" type="application/rss+xml" />
{% for post in site.posts limit:20 %}
<item>
<title>{{ post.title | xml_escape }}</title>
<description>
{% if post.subtitle %}{{ post.subtitle | xml_escape }} - {% endif %}
{{ post.content | strip_html | xml_escape | truncatewords: 50 }}
</description>
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
<link>{{ site.url }}{{ post.url }}</link>
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
</item>
{% endfor %}
</channel>
</rss>

|||||||
x
 
000:0
Loading…
Cancel
Save