--- /dev/null
+{%- set base_url = "http://mako.cc/" -%}
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xml:lang="en" lang="en">
+ <head>
+ <meta charset="UTF-8">
+ <title>{{ page_title }}{% if page_title %} :: {% endif %}Benjamin Mako Hill</title>
+ <link rel="stylesheet" type="text/css" href="{{base_url}}/latex-like.css" />
+ <link rel="shortcut icon" href="http://mako.cc/favicon.ico" />
+ </head>
+
+ <body>
+ <h1>{{page_title}}</h1>
+ <h2 class="author"><a href="http://mako.cc">Benjamin Mako Hill</a><br />
+ <span style="font-size: 0.9em;">mako@atdot.cc</span></h2>
+
+ {% block content_box %}
+ {% endblock %}
+
+ <div id="footer">
+ <hr />
+ © 1999-2013 <a href="/">Benjamin Mako Hill</a><br />
+ Licensed under the <a rel="license"
+ href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative
+ Commons Attribution-Share Alike 3.0 United States License</a>.<br />
+ More permissive licensing may be available on request.<br />
+
+ Last modified: {{last_modified}}
+ </div>
+
+<!-- Piwik -->
+<script type="text/javascript">
+var pkBaseURL = (("https:" == document.location.protocol) ? "https://analytics.mako.cc/" : "http://analytics.mako.cc/");
+document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
+</script><script type="text/javascript">
+try {
+var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
+piwikTracker.trackPageView();
+piwikTracker.enableLinkTracking();
+} catch( err ) {}
+</script><noscript><p><img src="http://analytics.mako.cc/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
+<!-- End Piwik Tracking Code -->
+ </body>
+</html>
+
--- /dev/null
+#!/usr/bin/env python
+
+import os
+import re
+import codecs
+from time import ctime
+from os.path import walk, getctime
+
+root = os.path.dirname(__file__)
+
+from jinja import Environment, FileSystemLoader
+jinja_env = Environment(loader=FileSystemLoader(root))
+
+def render_walk(arg=None, dirname='', filenames=[]):
+ for filename in filenames:
+ match = re.match(r'(.*)\.tmpl$', filename)
+ if match:
+ filename_base = match.group(1)
+
+ # skip if this is the layout file
+ if filename_base == 'layout': continue
+ if filename_base == 'latex-like-layout': continue
+
+ vars = { 'last_modified' :
+ unicode(ctime(getctime(os.path.join(dirname, filename)))) }
+
+ # remove the root from the dirname
+ dirname = re.sub(re.escape(root) + r'/?(.*)$', r'\1', dirname)
+
+ tmpl = jinja_env.get_template(os.path.join(dirname, filename))
+ tmpl.render(vars)
+
+ output_file = codecs.open(os.path.join(dirname, filename_base + '.html'), 'w', 'utf-8')
+ print >>output_file, tmpl.render(vars)
+ output_file.close()
+
+walk(root, render_walk, None)
+
+