all repos — py-vite @ 086bd7388515ac6ad12de7432be2d50f1f8d4bd6

the original vite, written in python

feat: create config.py in project dir
icyphox icyph0x@protonmail.com
Sat, 17 Mar 2018 16:04:58 +0530
commit

086bd7388515ac6ad12de7432be2d50f1f8d4bd6

parent

163b673e2be2ca5548b03c2513d7333831ca9cf9

2 files changed, 14 insertions(+), 3 deletions(-)

jump to
M README.mdREADME.md

@@ -20,14 +20,14 @@

## Templating Vite uses Jinja2 templating. A basic example would be: ```html -<title>{{ title }}</title> +<title> {{ title }} </title> <body> - {{ body }} +{{ body }} </body> <footer> - {{ footer }} +{{ footer }} </footer> ```
M vite.pyvite.py

@@ -27,10 +27,21 @@ cur_path = pathlib.Path('.').resolve()

pathlib.Path(path + '/pages').mkdir(parents=True, exist_ok=False) pathlib.Path(path + '/build').mkdir(exist_ok=False) pathlib.Path(path + '/templates').mkdir(exist_ok=False) + create_config(path) os.symlink(cur_path / 'make.py', abs_path / 'make.py') print('Created project directory at %s.' % (abs_path)) except FileExistsError as e: print('Error: specified path exists.') + +def create_config(path): + with open(path + '/config.py', 'w') as f: + f.write("""# config.py - Vite's configuration script + +title = '' +author = '' +header = '' +footer = '' + """) def build_project(path): try: