constance

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

templates/reading/reading.atom (809B) - 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')}reading.atom</id>
     11 <title type="text">${config.get('reading', 'title')}</title>
     12 <link rel="self" type="application/atom+xml" href="${config.get('global', 'url_base')}reading.atom" />
     13 <link rel="alternate" href="${config.get('global', 'url_base')}reading" />
     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>