diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bupa | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/bupa b/scripts/bupa index 1208263..e87ca4c 100755 --- a/scripts/bupa +++ b/scripts/bupa @@ -104,6 +104,8 @@ def build_journal(jinja_env): with open('build/journal.atom', 'wb') as file: file.write(atom_feed.to_string().encode('utf-8')) + make_sitemap(jinja_env, entries) + def build_page(jinja_env, template, pagename): page = parse('src/'+pagename+'.rst') page.body = reST_to_html(page.body) @@ -116,6 +118,12 @@ def write_page(page, header, filename, template, jinja_env): rendered_page = template.render(page=page, title=page.title, header=header) file.write(rendered_page.encode('utf-8')) +def make_sitemap(jinja_env, entries): + template = jinja_env.get_template('sitemap.xml') + with open('build/sitemap.xml', 'wb') as f: + rendered = template.render(entries=entries) + f.write(rendered.encode('utf-8')) + def main(): arguments = docopt.docopt(__doc__, version='bupa 0.0.1') jinja_env = Environment(loader=FileSystemLoader('src/templates')) # something something jinja2 templates |