feat(make.py): each .md gets its own dir
icyphox icyph0x@protonmail.com
Sat, 17 Mar 2018 19:24:19 +0530
1 files changed,
4 insertions(+),
1 deletions(-)
jump to
M
make.py
→
make.py
@@ -38,9 +38,12 @@ def main():
template_file = TEMPL_PATH + '/index.html' for page in os.listdir(PAGES_PATH): html_text = markdown_render(page) + html_path = os.path.splitext(os.path.join(BUILD_PATH, page))[0] + if not os.path.exists(html_path): + os.mkdir(html_path) html_file = os.path.splitext(page)[0] + '.html' output = jinja_render(html_text, template_file) - with open(BUILD_PATH + html_file, 'w') as f: + with open(os.path.join(html_path, 'index.html'), 'w') as f: f.write(output) print('Rendered %s' % (page))