diff options
| author | davidtsadler <davidtsadler@googlemail.com> | 2012-01-01 21:16:29 +0000 |
|---|---|---|
| committer | davidtsadler <davidtsadler@googlemail.com> | 2012-01-01 21:16:29 +0000 |
| commit | c8f60a4f4c8fab99eda2c3c8df3f655e3ba072f1 (patch) | |
| tree | 6663dd68649cb49b31111005c42e449e61cb3447 | |
| parent | ec9aeab275f199a104a9d48b4a190ac5b507e615 (diff) | |
Add RSS feed.
| -rw-r--r-- | _config.yml.example | 14 | ||||
| -rw-r--r-- | _site_build/_includes/footer.html | 2 | ||||
| -rw-r--r-- | _site_build/_includes/head.html | 2 | ||||
| -rw-r--r-- | _site_build/rss.xml | 32 |
4 files changed, 47 insertions, 3 deletions
diff --git a/_config.yml.example b/_config.yml.example index 75621c6..51fcf2e 100644 --- a/_config.yml.example +++ b/_config.yml.example @@ -2,6 +2,9 @@ # SITE CONFIG # *************************** +# Full url for the site minus the ending forward slash. +url: + # Appears in the <title> and <header> elements within the site. title: @@ -10,12 +13,16 @@ title: # Used in various places where the author of the site needs to appear. # For example, the copyright notice. +# Also appears in the RSS feed. author: +# Used in the meta description tag of the site and the description element of the RSS feed. +description: + # Optional information that appears in the 'Contact' sidebar. # Mainly used to generate URLs to various social sites. -# email address of the site author. +# email address of the site author. Also appears in the RSS feed if specified. #email: # Twitter name minus the @ character. @@ -24,9 +31,12 @@ author: # Git hub name. #github: -# Controls the number of recent posts shown on the main index page. +# Controls the number of recent posts shown on the main index page and in the RSS feed. max_recent_posts: 10 +# Used in the footer of the site and RSS feed. +copyright_year: + # Optional Google analytics. #google_ua: diff --git a/_site_build/_includes/footer.html b/_site_build/_includes/footer.html index 70bd3c5..b165e1d 100644 --- a/_site_build/_includes/footer.html +++ b/_site_build/_includes/footer.html @@ -1,5 +1,5 @@ <footer> <p> - <small>Copyright © 2011 by {{ site.author }}. All Rights Reserved.</small> + <small>Copyright © {{ site.copyright_year }} by {{ site.author }}. All Rights Reserved.</small> </p> </footer> diff --git a/_site_build/_includes/head.html b/_site_build/_includes/head.html index 54d16d0..d83eb39 100644 --- a/_site_build/_includes/head.html +++ b/_site_build/_includes/head.html @@ -1,5 +1,7 @@ <meta charset="utf-8"> <title>{{ page.title }} - {{ site.title }}</title> +<meta name="description" content="{{ site.description }}"> <meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="stylesheet" href="/css/style.css?v=1"> +<link rel="alternate" type="application/rss+xml" href="{{ site.url }}/rss.xml" title="{{ site.title }}"> <script src="/js/modernizr-2.0.6.min.js"></script> diff --git a/_site_build/rss.xml b/_site_build/rss.xml new file mode 100644 index 0000000..e5ef11f --- /dev/null +++ b/_site_build/rss.xml @@ -0,0 +1,32 @@ +--- +layout: nil +--- +<?xml version="1.0" encoding="UTF-8"?> +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ site.title }}</title> + <link>{{ site.url }}</link> + <atom:link href="{{ site.url }}/rss.xml" rel="self" type="application/rss+xml" /> + <description>{{ site.description }}</description> + <copyright>Copyright {{ site.copyright_year }} by {{ site.author }}. All Rights Reserved.</copyright> + {% if site.email %} + <managingEditor>{{ site.email }} ({{ site.author }})</managingEditor> + <webMaster>{{ site.email }} ({{ site.author }})</webMaster> + {% endif %} + <pubDate>{{ site.time | date: "%a, %d %b %Y %H:%M:%S %z"}}</pubDate> + <lastBuildDate>{{ site.time | date: "%a, %d %b %Y %H:%M:%S %z" }}</lastBuildDate> + <ttl>1440</ttl> + {% for post in site.posts limit:site.max_recent_posts %} + <item> + <title>{{ post.title }}</title> + <link>{{ site.url }}{{ post.url }}</link> + <guid isPermaLink="true">{{ site.url}}{{ post.url}}</guid> + <pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate> + {% if site.email %} + <author>{{ site.email }} ({{ site.author }})</author> + {% endif %} + <description>{{ post.content | text_excerpt | xml_escape }}</description> + </item> + {% endfor %} + </channel> +</rss> |
