0
0
Fork 0
zero-blog/views/atom.haml

19 lines
767 B
Plaintext

!!! XML
%feed{:xmlns => 'http://www.w3.org/2005/Atom'}
%title=title
%subtitle=subtitle
%link{:href => domain}
%link{:type => 'application/atom+xml', :rel => "self", :href => domain('/atom.xml')}
%updated=Post.get_all_released.last.written.xmlschema
%id=domain
-@posts.each do |post|
%entry
%id=domain("/post/#{post.id}")
%link{:type => 'text/html', :rel => "alternate", :href => "/post/#{post.id}"}
%title=post.title
%updated=post.written.xmlschema
%author
%name=post.account.username
%summary{:type => 'html'}=markup(post.content, post.markup).match(/.*?<\/p>/m)[0].gsub(/</, '&lt;').gsub(/>/, '&gt;')
%content{:type => 'html'}=markup(post.content, post.markup).gsub(/</, '&lt;').gsub(/>/, '&gt;')