A simple and minimal static site generator.
Project description
A simple and mnml static site generator that Just Works™
Installation
$ pip install vite
Usage
$ vite new <project-path>
Write your Markdown files in the pages directory and execute:
$ vite build # in project directory
Rendered HTML will be in the build directory.
Finally, run:
$ vite serve # also in the project directory
to serve the contents of the build directory.
Configuration
Not very sophisticated, but basic configuration can be acheived using
config.py found in the project directory.
Example config:
# config.py
title = ''
author = ''
header = ''
footer = ''
template = 'index.html' # default is templates/index.html
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
---
## markdown here
...
Notes on templating
- Stylesheets, images and JS can be accessed from the
staticfolder. index.html, i.e. your website's homepage, should be_index.mdin thepages/directory.
Directory tree
example
├── build
├── config.py
├── pages
│ └── test.md
├── static
└── templates
└── index.html
TODO
- Templating
- CSS support
- Implement a simple HTTP server (later)
- Add example site
- Basic config (
config.py) - Parsing frontmatter (JSON, YAML, TOML) for per-page options
- Better support for home page (main
index.htmlpage)
Credits
Logo credits: Freepik from www.flaticon.com is licensed by CC 3.0 BY
Hue: UltimateHackers/hue
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vite-1.3.1-py3-none-any.whl.
File metadata
- Download URL: vite-1.3.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f064f2e56c740af763eb536e835fa09fe7e9143cf908f5543e013c972c02c875
|
|
| MD5 |
30199bee3d879211e196049f3b2491b7
|
|
| BLAKE2b-256 |
c40e58a5dd4e947ec2e04c749f58bd4cdf68648cb0dccde9de69f3f665f59345
|