all repos — py-vite @ 77ed1a52fafe8e8366f90f217cd8dca2ea507c67

the original vite, written in python

fix: prevent rendering non-markdown files
Anirudh icyph0x@pm.me
Sat, 16 Jun 2018 15:43:55 +0530
commit

77ed1a52fafe8e8366f90f217cd8dca2ea507c67

parent

181a63cdd863e461c679c8f8c6a94abe39c1d032

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

jump to
M vite/vite.pyvite/vite.py

@@ -11,6 +11,7 @@ import jinja2

import time import http.server import socketserver +import shutil from markdown2 import markdown_path from huepy import *

@@ -107,7 +108,9 @@

def html_gen(): for page in os.listdir(PAGES_PATH): - if page == '_index.md': + if os.path.splitext(page)[1] != '.md': + shutil.copyfile(os.path.join(PAGES_PATH, page), os.path.join(BUILD_PATH, page)) + elif page == '_index.md': index_html = markdown_render(page) output = jinja_render(index_html, TEMPL_FILE) with open(os.path.join(BUILD_PATH, 'index.html'), 'w') as f: