atom.xml.haml 1.16 KB
Newer Older
Sean Packham's avatar
Sean Packham committed
1 2 3 4 5 6 7 8 9 10
!!! XML
%feed{:xmlns => "http://www.w3.org/2005/Atom"}

  - site_url = "https://about.gitlab.com/blog/"

  %title GitLab
  %id= URI.join(site_url, blog.options.prefix.to_s)
  %link{:href => site_url}

  - unless blog.articles.empty?
11
    %updated= blog.articles.first.date.to_datetime.rfc3339
Sean Packham's avatar
Sean Packham committed
12 13 14 15 16
  %author
    %name The GitLab Team

  - blog.articles[0..20].each do |article|
    %entry
17
      %title= h(article.title)
Sean Packham's avatar
Sean Packham committed
18 19
      %link{:rel => "alternate", :href => URI.join(site_url, article.url)}
      %id= URI.join(site_url, article.url)
20 21
      %published= article.date.to_datetime.rfc3339
      %updated= article.date.to_datetime.rfc3339
Sean Packham's avatar
Sean Packham committed
22
      %author
23
        %name= h(article.data.author)
Sean Packham's avatar
Sean Packham committed
24 25 26 27 28 29 30 31 32 33 34

      - if article.metadata[:options][:layout] == 'release'
        %content{:type => "html"}
          - path = article.path[6..article.path.length]
          - filename = File.basename(path, File.extname(path)).gsub("-", "_")
          - datafile = data.release_posts[filename]

          = xml_feed_content(article)
          = h(partial("includes/release", :locals => { :datafile => datafile, :current_article => article }))
      - else
        %content{:type => "html"}= xml_feed_content(article)