lib/nanoc/helpers/blogging.rb in nanoc-3.7.3 vs lib/nanoc/helpers/blogging.rb in nanoc-3.7.4
- old
+ new
@@ -85,11 +85,11 @@
xml = Builder::XmlMarkup.new(:target => buffer, :indent => 2)
build_for_feed(xml)
buffer
end
- protected
+ protected
def sorted_relevant_articles
relevant_articles.sort_by do |a|
attribute_to_time(a[:created_at])
end.reverse.first(limit)
@@ -130,24 +130,24 @@
xml.instruct!
xml.feed(:xmlns => 'http://www.w3.org/2005/Atom') do
root_url = @site.config[:base_url] + '/'
# Add primary attributes
- xml.id root_url
- xml.title title
+ xml.id root_url
+ xml.title title
# Add date
xml.updated(attribute_to_time(last_article[:created_at]).to_iso8601_time)
# Add links
xml.link(:rel => 'alternate', :href => root_url)
xml.link(:rel => 'self', :href => feed_url)
# Add author information
xml.author do
- xml.name author_name
- xml.uri author_uri
+ xml.name author_name
+ xml.uri author_uri
end
# Add icon and logo
xml.icon icon if icon
xml.logo logo if logo
@@ -164,31 +164,31 @@
url = url_for(a)
return if url.nil?
xml.entry do
# Add primary attributes
- xml.id atom_tag_for(a)
- xml.title a[:title], :type => 'html'
+ xml.id atom_tag_for(a)
+ xml.title a[:title], :type => 'html'
# Add dates
xml.published attribute_to_time(a[:created_at]).to_iso8601_time
- xml.updated attribute_to_time(a[:updated_at] || a[:created_at]).to_iso8601_time
+ xml.updated attribute_to_time(a[:updated_at] || a[:created_at]).to_iso8601_time
# Add specific author information
if a[:author_name] || a[:author_uri]
xml.author do
- xml.name a[:author_name] || author_name
- xml.uri a[:author_uri] || author_uri
+ xml.name a[:author_name] || author_name
+ xml.uri a[:author_uri] || author_uri
end
end
# Add link
xml.link(:rel => 'alternate', :href => url)
# Add content
summary = excerpt_proc.call(a)
- xml.content content_proc.call(a), :type => 'html'
- xml.summary summary, :type => 'html' unless summary.nil?
+ xml.content content_proc.call(a), :type => 'html'
+ xml.summary summary, :type => 'html' unless summary.nil?
end
end
end