Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RSS feed to the theme #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ stackoverflow_url:
pinterest_url:
slack_url:
dribbble_url:
# The full url of your site with "/feed.xml", e.g. https://mydomain.me/feed.xml
rss_url:

# Google Analytics Tracking ID goes here:
google_analytics:
Expand Down
3 changes: 3 additions & 0 deletions _includes/social_icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@
{%- if site.email -%}
<li><a href="mailto:{{- site.email -}}" class="icon fa-envelope"><span class="label">Email</span></a></li>
{%- endif -%}
{%- if site.rss_url -%}
<li><a href="{{- site.rss_url -}}" class="icon fa-rss"><span class="label">RSS</span></a></li>
{%- endif -%}
</ul>
22 changes: 22 additions & 0 deletions feed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
layout: none
---

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ site.name | 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:10 %}
<item>
<title>{{ post.title | xml_escape }}</title>
<description>{{ post.content | xml_escape }}</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>