summaryrefslogtreecommitdiffstats
path: root/scripts/bupa
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bupa')
-rwxr-xr-xscripts/bupa9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/bupa b/scripts/bupa
index b982ec8..0ed31e6 100755
--- a/scripts/bupa
+++ b/scripts/bupa
@@ -46,16 +46,21 @@ def parse(filename):
return page
def build_journal(env):
- template = env.get_template('journal.html')
+ template = env.get_template('journal.html')
+ entry_tmpl = env.get_template('entry.html')
files = os.listdir('src/journal')
files.sort(key=filename_to_id, reverse=True)
entries = []
for file in files:
entry = parse('src/journal/' + file)
- entry.body = reST_to_html(entry.body)
entry.id = filename_to_id(file)
+ entry.page = 'journal/' + file.split('.', 1)[0] + '.html'
+ entry.body = reST_to_html(entry.body)
entries += [entry]
+ with open('build/'+entry.page, 'w') as file:
+ file.write(entry_tmpl.render(entry=entry, title='~/journal',
+ header='The lost journal'))
with open('build/journal.html', 'w') as file:
file.write(template.render(entries=entries, title='~/journal', header='The lost journal'))