feed.pug 1.1 KB

1234567891011121314151617181920212223242526272829
  1. doctype xml
  2. rss(version='2.0',
  3. xmlns:content='http://purl.org/rss/1.0/modules/content/',
  4. xmlns:wfw='http://wellformedweb.org/CommentAPI/',
  5. xmlns:dc='http://purl.org/dc/elements/1.1/'
  6. xmlns:atom='http://www.w3.org/2005/Atom')
  7. channel
  8. - var articles = env.helpers.getArticles(contents);
  9. title= locals.name
  10. atom:link(href=locals.url + '/feed.xml', rel='self', type='application/rss+xml')
  11. link= locals.url
  12. description= locals.description
  13. pubDate= articles[0].rfc822date
  14. generator Wintersmith - https://github.com/jnordberg/wintersmith
  15. language en
  16. each article in articles
  17. - var permalink = locals.url + article.url;
  18. item
  19. title= article.title
  20. link= permalink
  21. pubDate= article.rfc822date
  22. guid(isPermaLink='true')= permalink
  23. - var author = contents.authors[article.metadata.author + '.json'];
  24. if author
  25. author= author.metadata.name
  26. else
  27. author= article.author
  28. //- passing locals.url resolves all relative urls to absolute
  29. description= article.getHtml(locals.url)