constance

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

templates/blog/entry.html (1843B) - 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 viewutils import tag_list
      7 ?>
      8 
      9 <head>
     10     <title>${item.title.striptags()} &#183; ${config.get('blog', 'title')}</title>
     11     <meta name="dcterms.issued" content="${item.publication_date.strftime(str('%Y-%m-%d'))}" />
     12 </head>
     13 <body>
     14     <article class="item blog-entry" py:attrs="(item.language is not None) and {'lang': item.language} or {}">
     15 
     16         <h1 class="entry-title">${item.title} <a href="${config.get('global', 'url_base')}blog/${item.id}" rel="bookmark" class="icon icon-link"></a></h1>
     17 
     18         <div class="entry-content">
     19             ${item.body}
     20         </div>
     21 
     22         <p class="meta">
     23             Originally published <time datetime="${item.publication_date.strftime(str('%Y-%m-%d %H:%M:%S%Z'))}" pubdate="">${item.publication_date.strftime(str('%-1d %B %Y'))}</time>.
     24             <py:if test="item.tags">
     25                 Tagged: ${tag_list(item.tags)}.
     26             </py:if>
     27         </p>
     28 
     29         <py:if test="config.get('disqus', 'site')">
     30         <div id="disqus_thread"></div>
     31         <script type="text/javascript">
     32           var disqus_url = 'http://' + window.location.host + window.location.pathname.replace(/\.html$/, '');
     33           (function() {
     34            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
     35            dsq.src = '//${config.get("disqus", "site")}.disqus.com/embed.js';
     36            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
     37           })();
     38         </script>
     39         <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=${config.get('disqus', 'site')}">comments powered by Disqus.</a></noscript>
     40         </py:if>
     41 
     42     </article>
     43 </body>
     44 </html>