forked from reudnetz/website
start using gohugo.io to enable markdown pages
This commit is contained in:
parent
2e078fc88c
commit
165063f360
25 changed files with 623 additions and 232 deletions
16
render.py
16
render.py
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/python2
|
||||
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
import os
|
||||
import stat
|
||||
|
||||
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
env = Environment(loader=FileSystemLoader('templates'))
|
||||
|
||||
for template in filter(lambda x : x.endswith(".html"), env.list_templates()):
|
||||
rendered = env.get_template(template).render(name=template).encode('utf-8')
|
||||
os.chmod(template, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH)
|
||||
with open(template, 'wb') as outfile:
|
||||
outfile.write(rendered)
|
||||
os.chmod(template, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
|
||||
Loading…
Add table
Add a link
Reference in a new issue