constance

Scripts for generating (an earlier obsolete version of) my personal web site
git clone https://code.djc.id.au/git/constance/

templates/blog/index.atom (810B) - raw

      1 <feed xmlns="http://www.w3.org/2005/Atom"
      2       xmlns:py="http://genshi.edgewall.org/"
      3 	  xmlns:xi="http://www.w3.org/2001/XInclude">
      4 
      5 <?python
      6 from viewutils import ATOM_TIME_FORMAT
      7 sorted_items = sorted(items, key=lambda item: item.publication_date, reverse=True)
      8 ?>
      9 
     10 <id>${config.get('global', 'url_base')}blog/index.atom</id>
     11 <title type="text">${config.get('blog', 'title')}</title>
     12 <link rel="self" type="application/atom+xml" href="${config.get('global', 'url_base')}blog/index.atom" />
     13 <link rel="alternate" href="${config.get('global', 'url_base')}blog/" />
     14 <generator>constance</generator>
     15 <updated py:if="sorted_items">${max(item.modified_date for item in sorted_items).strftime(ATOM_TIME_FORMAT)}</updated>
     16 
     17 <py:for each="item in sorted_items">
     18     ${item.generate_atom(config)}
     19 </py:for>
     20 
     21 </feed>