2019-11-13 03:21:51 +01:00
|
|
|
xml.instruct!
|
|
|
|
xml.feed xmlns: "http://www.w3.org/2005/Atom" do
|
|
|
|
blog_url = "#{config[:host]}/blog"
|
|
|
|
xml.title "Sass Blog"
|
|
|
|
xml.id blog_url
|
|
|
|
xml.link href: blog_url
|
|
|
|
xml.link href: "#{config[:host]}/feed.xml", rel: "self"
|
|
|
|
xml.updated(blog.articles.first.date.to_time.iso8601) unless blog.articles.empty?
|
|
|
|
|
|
|
|
blog.articles[0..5].each do |article|
|
|
|
|
xml.entry do
|
2019-11-13 23:54:11 +01:00
|
|
|
url = config[:host] + without_html(article.url)
|
2019-11-13 03:21:51 +01:00
|
|
|
xml.title article.title
|
|
|
|
xml.link href: url, rel: "alternate"
|
|
|
|
xml.id url
|
|
|
|
xml.published article.date.to_time.iso8601
|
|
|
|
xml.updated File.mtime(article.source_file).iso8601
|
|
|
|
xml.author { xml.name article.data.author }
|
|
|
|
xml.content article.body, "type" => "html"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|