all repos — py-vite @ 33c876415042f8065b37772d981013b5b97cb3a8

the original vite, written in python

README.md (view raw)

  1<h1 align="center">
  2	<img width="300" src="https://xix.ph0x.me/vitelogo.png" alt="Vite">
  3</h1>
  4
  5> A simple and mnml static site generator that Just Works™
  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
 12<h1 align="center">
 13    <img width="750" src="https://xix.ph0x.me/vite_epi.png" alt="Vite demo">
 14</h1>
 15
 16Installation
 17------------
 18
 19```console
 20$ pip install vite
 21```
 22Usage
 23-----
 24
 25```console
 26$ vite new <project-path>
 27```
 28Write your Markdown files in the `pages` directory and execute:
 29```console
 30$ vite build   # in project directory
 31```
 32Rendered HTML will be in the `build` directory.
 33
 34Finally, run:
 35```console
 36$ vite serve  # also in the project directory
 37```
 38to serve the contents of the `build` directory.
 39
 40Configuration
 41-------------
 42
 43Not very sophisticated, but basic configuration can be acheived using
 44  `config.py` found in the project directory.
 45Example config:
 46
 47```python
 48# config.py 
 49title = ''
 50author = ''
 51header = ''
 52footer = '' 
 53template = 'index.html'  # default is templates/index.html
 54```
 55
 56Templating
 57----------
 58
 59Vite uses Jinja2 templating, so template files must be placed in a separate `templates/` directory.  
 60A basic example would be:
 61```html
 62<link rel="stylesheet" href="../static/sakura-earthy.css">
 63
 64<title> {{ title }} </title>
 65
 66<body>
 67{{ body }}
 68</body>
 69
 70<footer>
 71{{ footer }}
 72</footer>
 73```
 74### Notes on templating
 75
 76- Stylesheets, images and JS can be accessed from the `static` folder.
 77- `index.html`, i.e. your website's homepage, should be `_index.md` in the `pages/` directory.
 78
 79
 80
 81Directory tree
 82--------------
 83
 84    example
 85    ├── build
 86    ├── config.py
 87    ├── pages
 88    │   └── test.md
 89    ├── static
 90    └── templates
 91        └── index.html
 92
 93TODO
 94----
 95
 96- [x] Templating
 97- [x] CSS support
 98- [x] Implement a simple HTTP server (*later*)
 99- [x] Add example site
100- [x] Basic config (`config.py`)
101- [ ] Parsing frontmatter (JSON, YAML, TOML)
102- [x] Better support for home page (main `index.html` page)
103
104
105## Credits
106_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>  
107_Hue_: [UltimateHackers/hue](https://github.com/UltimateHackers/hue)
108