all repos — py-vite @ 62ddcd5c929b5a6d58f17b54473dcc7c5d159f4a

the original vite, written in python

feat(make.py): each .md gets its own dir
icyphox icyph0x@protonmail.com
Sat, 17 Mar 2018 19:24:19 +0530
commit

62ddcd5c929b5a6d58f17b54473dcc7c5d159f4a

parent

fc9ef9169086b475c9f063ca20c3ea78daac90f8

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M make.pymake.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))