From faa336e3b58a3a51edcfd5da191dc0dcdac3b2be Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 16 Mar 2015 02:21:36 +0300 Subject: [PATCH] gen-sitemap: generate template --- gen-sitemap.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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)) -- 2.39.2