🌀 a static site generator that Just Works™
Branch: master
Clone or download
icyphox docs: remove credits
Signed-off-by: Anirudh <icyph0x@pm.me>
Latest commit d2732b9 Oct 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example docs: add `example/` dir again Apr 25, 2018
vite chore: bump to v1.3.2 Oct 26, 2018
.gitignore chore: update .gitignore with .vscode/ dir Apr 19, 2018
LICENSE docs: update mail in LICENSE Jun 19, 2018
README.md docs: remove credits Oct 26, 2018
requirements.txt chore(deps): update dependency version Oct 23, 2018
setup.py chore: bump to 1.2.2 Apr 27, 2018

README.md

vite

A simple and mnml static site generator that Just Works™

forthebadge forthebadge forthebadge forthebadge

Vite demo

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 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

  • 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.html page)