vite
A simple and mnml static site generator that Just Works™
Installation
$ pip install vite
Usage
$ vite init path/to/project
$ vite new blog/some-post.md
This creates pages/blog/some-post.md
.
And then:
$ vite build
Rendered HTML will be in the build
directory.
Finally, run:
$ vite serve
Configuration
Not very sophisticated, but basic configuration can be acheived using
config.py
found in the project directory.
Example config:
title = ''
author = ''
header = ''
footer = ''
template = 'index.html'
post_build = []
Templating
Vite uses Jinja2 templating, so template files must be placed in a separate templates/
directory.
A basic example would be:
<link rel="stylesheet" href="/static/sakura-earthy.css">
<title> {{ title }} </title>
<body>
{{ body }}
</body>
<footer>
{{ footer }}
</footer>
Specifying per-page templates
Vite allows for specifying a unique template, per page. This is acheived by including YAML frontmatter at the top of the Markdown file, like so:
---
template: foo.html
title: Some fancy buzzwords here
subtitle: Cool catch phrase here
date: 2019-08-09
---
## markdown here
...
Notes on templating
- Stylesheets, images and JS can be accessed from the
static
folder. index.html
, i.e. your website's homepage, should be _index.md
in the pages/
directory.
Directory tree
example
├── build
├── config.py
├── pages
│ └── test.md
├── static
└── templates
└── index.html
TODO