diff options
author | Lars Henrik Mai <lars.mai@kontinui.de> | 2014-04-08 13:58:00 +0200 |
---|---|---|
committer | Lars Henrik Mai <lars.mai@kontinui.de> | 2014-04-08 13:58:00 +0200 |
commit | b0da6603c012280a33202836bb1e9a2456fbd054 (patch) | |
tree | 960d807a49c79f210b7307e87ce43ddf8524038d /source/feed.xml.builder | |
parent | 3b2ecefb6b3f763762f191452e40c59fb7f58ec5 (diff) |
initialized blog extensions
Diffstat (limited to 'source/feed.xml.builder')
-rw-r--r-- | source/feed.xml.builder | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/feed.xml.builder b/source/feed.xml.builder new file mode 100644 index 0000000..6fa9c08 --- /dev/null +++ b/source/feed.xml.builder @@ -0,0 +1,24 @@ +xml.instruct! +xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do + site_url = "http://blog.url.com/" + xml.title "Blog Name" + xml.subtitle "Blog subtitle" + xml.id URI.join(site_url, blog.options.prefix.to_s) + xml.link "href" => URI.join(site_url, blog.options.prefix.to_s) + xml.link "href" => URI.join(site_url, current_page.path), "rel" => "self" + xml.updated(blog.articles.first.date.to_time.iso8601) unless blog.articles.empty? + xml.author { xml.name "Blog Author" } + + blog.articles[0..5].each do |article| + xml.entry do + xml.title article.title + xml.link "rel" => "alternate", "href" => URI.join(site_url, article.url) + xml.id URI.join(site_url, article.url) + xml.published article.date.to_time.iso8601 + xml.updated File.mtime(article.source_file).iso8601 + xml.author { xml.name "Article Author" } + # xml.summary article.summary, "type" => "html" + xml.content article.body, "type" => "html" + end + end +end |