all repos — py-vite @ 7e889b37bc1a5b7f4b5d7630892cdaba87f1e297

the original vite, written in python

README.md (view raw)

  1<h1 align="center">
  2	<img width="400" src="https://xix.ph0x.me/vitelogo.png" alt="Vite">
  3</h1>
  4
  5> A simple and mnml static site generator; pronounced as /vit/
  6
  7[![forthebadge](https://forthebadge.com/images/badges/60-percent-of-the-time-works-every-time.svg)](https://forthebadge.com)
  8[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)
  9[![forthebadge](https://forthebadge.com/images/badges/powered-by-electricity.svg)](https://forthebadge.com)
 10[![forthebadge](https://forthebadge.com/images/badges/uses-git.svg)](https://forthebadge.com)
 11
 12Installation
 13------------
 14
 15Clone this repo and:
 16```console
 17$ pip3 install -r requirements.txt
 18```
 19**NOTE**: Don't delete the cloned repo, since `make.py` is symlinked upon project creation.
 20
 21Usage
 22-----
 23
 24```console
 25$ ./vite.py new <project-path>
 26```
 27Write your Markdown files in the `pages` directory and execute:
 28```console
 29$ ./make.py   # in project directory
 30```
 31Rendered HTML will be in the `build` directory.
 32
 33Finally, run:
 34```console
 35$ ./make.py serve
 36```
 37to serve the contents of the `build` directory.
 38
 39Configuration
 40-------------
 41
 42Not very sophisticated, but basic configuration can be acheived using
 43  `config.py` found in the project directory.
 44Example config:
 45
 46```python
 47# config.py 
 48title = ''
 49author = ''
 50header = ''
 51footer = '' 
 52template = 'index.html'  # default is index.html
 53```
 54
 55Templating
 56----------
 57
 58Vite uses Jinja2 templating.  
 59**NOTE**: Stylesheets, images and JS can be accessed from the `static` folder.
 60
 61A basic example would be:
 62```html
 63<link rel="stylesheet" href="../static/sakura-earthy.css">
 64
 65<title> {{ title }} </title>
 66
 67<body>
 68{{ body }}
 69</body>
 70
 71<footer>
 72{{ footer }}
 73</footer>
 74```
 75
 76Directory tree
 77--------------
 78
 79    example
 80    ├── build
 81    ├── config.py
 82    ├── make.py -> /home/icyphox/code/vite/make.py
 83    ├── pages
 84    ├── static
 85    └── templates
 86        └── index.html
 87
 88TODO
 89----
 90
 91- [x] Templating
 92- [x] CSS support
 93- [x] Implement a simple HTTP server (*later*)
 94- [x] Add example site
 95- [x] Basic config (`config.py`)
 96
 97
 98## Credits
 99_Logo credits_: <a href="http://www.freepik.com" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a>  
100_Hue_: [UltimateHackers/hue](https://github.com/UltimateHackers/hue)
101