Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 4 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
View
5 lib/awestruct/extensions/atomizer.rb
@@ -6,6 +6,8 @@ def initialize(entries_name, output_path, opts={})
@entries_name = entries_name
@output_path = output_path
@num_entries = opts[:num_entries] || 50
+ @content_url = opts[:content_url]
+ @feed_title = opts[:feed_title]
end
def execute(site)
@@ -32,7 +34,8 @@ def execute(site)
page.date = page.timestamp unless page.timestamp.nil?
page.output_path = @output_path
page.entries = atom_pages
- page.title = site.title || site.base_url
+ page.title = @feed_title || site.title || site.base_url
+ page.content_url = @content_url || site.base_url
site.pages << page
end
View
7 lib/awestruct/extensions/template.atom.haml
@@ -3,7 +3,7 @@
!!! XML
%feed{ 'xml:lang'=>'en-US', :xmlns=>'http://www.w3.org/2005/Atom' }
- %id= "#{site.base_url}/"
+ %id= "#{page.content_url}/"
%title= escape_once( page.title )
- if ( defined?( site.author ) )
%author
@@ -16,12 +16,13 @@
- unless page.entries.empty?
%updated= page.entries.first.date.xmlschema
%link{:rel=>"self", :type=>"application/atom+xml", :href=>"#{site.base_url}#{page.url}" }
- %link{:rel=>"alternate", :type=>"text/html", :href=>"#{site.base_url}/" }
+ %link{:rel=>"alternate", :type=>"text/html", :href=>"#{page.content_url}/" }
- for entry in page.entries
%entry
%id #{site.base_url}#{entry.url}
%title= escape_once( entry.title )
%updated= entry.date.xmlschema
+ %published= entry.date.xmlschema
%link{:rel=>"alternate", :type=>"text/html", :href=>"#{site.base_url}#{entry.url}" }
- if ( defined?( entry.author ) )
%author
@@ -32,7 +33,7 @@
- else
%name= entry.author
%summary
- #{summarize( html_to_text( entry.content ), 100 )}...
+ #{summarize( html_to_text( entry.content ), 100 )}
%content{:type=>'html'}
= clean_html( html_escape( fully_qualify_urls( site.base_url, find_and_preserve( entry.content ) ) ) )

No commit comments for this range

Something went wrong with that request. Please try again.