-
Notifications
You must be signed in to change notification settings - Fork 95
/
atom.template.haml
42 lines (40 loc) · 1.64 KB
/
atom.template.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
---
!!! XML
%feed{ 'xml:lang'=>'en-US', :xmlns=>'http://www.w3.org/2005/Atom' }
%id= "#{page.content_url}/"
%title= escape_once( page.title )
- if ( not site.author.nil? )
%author
- if ( defined?( site.author.name ) )
%name= site.author.name
- if ( site.author.email )
%email= site.author.email
- else
%name= site.author
- unless page.entries.empty?
%updated= last_commit_or_modifed_date(".#{page.entries.first.relative_path}").xmlschema
%link{:rel=>"self", :type=>"application/atom+xml", :href=>"#{site.base_url}#{page.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= last_commit_or_modifed_date(".#{entry.relative_path}").xmlschema
%published= entry.date.xmlschema
%link{:rel=>"alternate", :type=>"text/html", :href=>"#{site.base_url}#{entry.url}" }
- if ( not entry.author.nil? )
%author
- if ( defined?( entry.author.name ) )
%name= entry.author.name
- if ( entry.author.email )
%email= entry.author.email
- else
%name= entry.author
- if ( not entry.tags.nil? )
- for tag in entry.tags
%category{:term=>"#{tag}"}
%summary
#{summarize( html_to_text( entry.content ), 100 )}
%content{:type=>'html'}
= clean_html( html_escape( fully_qualify_urls( site.base_url, find_and_preserve( "<div>#{entry.content}</div>" ) ) ) )