summaryrefslogtreecommitdiffstats
path: root/scripts/bupa
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-10-15 18:39:56 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2014-10-15 18:40:45 +0100
commitb8cd2d937eb0e305509d1ffc70a52315320541c8 (patch)
tree81f2b020f274c2128b8aeff19561130014d33923 /scripts/bupa
parent965c9e67ef6f79b9cf72a01da03222a66d632569 (diff)
downloadwebsite-b8cd2d937eb0e305509d1ffc70a52315320541c8.tar.xz
refactor bupa slightly, add isso comments on separate entry pages
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'))