From: Oleg Broytman Date: Sun, 15 Mar 2015 23:21:36 +0000 (+0300) Subject: gen-sitemap: generate template X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=faa336e3b58a3a51edcfd5da191dc0dcdac3b2be;p=phdru.name%2Fphdru.name.git gen-sitemap: generate template --- diff --git a/gen-sitemap.py b/gen-sitemap.py index 63b34a2..088f838 100755 --- a/gen-sitemap.py +++ b/gen-sitemap.py @@ -67,4 +67,20 @@ def _tree2html(tree, level=0): strings.append(indent + "") return '\n'.join(strings) -write_if_changed("sitemap.html", _tree2html(tree[1])) +sitemap_tmpl = ["""\ +#extends phd_site +#implements respond +#attr $Title = 'Sitemap' +#attr $Copyright = 2015 +## +#def body_html +"""] + +sitemap_tmpl.append(_tree2html(tree[1])) + +sitemap_tmpl.append(""" +#end def +$phd_site.respond(self) +""") + +write_if_changed("sitemap.tmpl", ''.join(sitemap_tmpl))