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.html (948B) - raw

      1 <html xmlns="http://www.w3.org/1999/xhtml"
      2       xmlns:py="http://genshi.edgewall.org/"
      3 	  lang="en-AU">
      4 
      5 <?python
      6 from itertools import groupby
      7 from viewutils import markdown, mini_markdown, tag_list
      8 ?>
      9 
     10 <head>
     11     <title>${config.get('blog', 'title')}</title>
     12     <link rel="alternate" type="application/atom+xml" title="Atom feed" href="index.atom" />
     13 </head>
     14 
     15 <body>
     16 <section>
     17     <h1>${config.get('blog', 'title')}</h1>
     18 
     19     <py:for each="year, items in groupby(sorted(items, key=lambda e: e.publication_date, reverse=True), key=lambda e: e.publication_date.year)">
     20         <h2>${year}</h2>
     21         <ul class="blog-index">
     22             <li py:for="item in items">
     23                 <a href="${item.id}">${item.title}</a>
     24                 <time datetime="${item.publication_date.strftime(str('%Y-%m-%d %H:%M:%S%Z'))}">${item.publication_date.strftime(str('%-1d %B'))}</time>
     25             </li>
     26         </ul>
     27     </py:for>
     28 </section>
     29 </body>
     30 </html>