Permalink
Browse files

Add Sitemap and Atom feed.

  • Loading branch information...
jasoncodes committed Dec 12, 2010
1 parent 5e83fe1 commit 46446f57fb55cc6171410517e3565764203b0abf
Showing with 69 additions and 1 deletion.
  1. +7 −0 _config.yml
  2. +1 −1 _layouts/default.html
  3. +28 −0 atom.xml
  4. +9 −0 bin/jekyll
  5. +1 −0 robots.txt
  6. +23 −0 sitemap.xml
View
@@ -6,3 +6,10 @@ server_port: 3000
exclude:
- Rakefile
- bin
+
+title: Jason Codes
+url: http://jasoncodes.com
+
+author:
+ name: Jason Weathered
+ email: jason@jasoncodes.com
View
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{% if !page.title %} {{ page.title }} &ndash; {% endif %}Jason Codes :: code &amp; rants of Jason Weathered</title>
- <meta name="author" content="Jason Weathered" />
+ <meta name="author" content="{{ site.author.name }}" />
<link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/images/favicon.ico" />
<link rel="icon" type="image/png" href="/images/favicon.png" />
<link rel="apple-touch-icon" type="image/png" href="/images/apple-touch-icon.png" />
View
@@ -0,0 +1,28 @@
+---
+layout: nil
+---
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+
+ <title>{{ site.title }}</title>
+ <subtitle>{{ site.description }}</subtitle>
+ <link href="{{ site.url }}{{ site.feed }}" rel="self" type="application/atom+xml" />
+ <link href="{{ site.url }}/" rel="alternate" type="text/html" />
+ <id>{{ site.url }}/</id>
+ <updated>{{ site.time | date_to_xmlschema }}</updated>
+ <author>
+ <name>{{ site.author.name }}</name>
+ <email>{{ site.author.email }}</email>
+ </author>
+
+ {% for post in site.posts %}
+ <entry>
+ <title type="html">{{ post.title | xml_escape }}</title>
+ <link href="{{ site.url }}{{ post.url }}" rel="alternate" type="text/html" />
+ <updated>{{ post.last_modified | date_to_xmlschema }}</updated>
+ <id>{{ site.url }}{{ post.id }}</id>
+ <content type="html">{{ post.content | xml_escape }}</content>
+ </entry>
+ {% endfor %}
+
+</feed>
View
@@ -48,6 +48,15 @@ class Jekyll::Post
self.ext = ext
end
+ def initialize_with_updated(site, source, dir, name)
+ initialize_without_updated(site, source, dir, name)
+ self.data['updated'] = if self.data.has_key? 'updated'
+ Time.parse self.data['updated'].to_s
+ end
+ self.data['last_modified'] = self.data['updated'] || self.date
+ end
+ alias_method_chain :initialize, :updated
+
end
jekyll_bin_path = Gem.bin_path('jekyll')
View
@@ -0,0 +1 @@
+Sitemap: http://jasoncodes.com/sitemap.xml
View
@@ -0,0 +1,23 @@
+---
+layout: nil
+---
+<?xml version="1.0" encoding="UTF-8"?>
+<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+
+ <url>
+ <loc>{{ site.url }}/</loc>
+ <lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
+ <changefreq>weekly</changefreq>
+ <priority>1.0</priority>
+ </url>
+
+ {% for post in site.posts %}
+ <url>
+ <loc>{{ site.url }}{{ post.url }}</loc>
+ <lastmod>{{ post.last_modified | date_to_xmlschema }}</lastmod>
+ <changefreq>monthly</changefreq>
+ <priority>0.5</priority>
+ </url>
+ {% endfor %}
+
+</urlset>

0 comments on commit 46446f5

Please sign in to comment.