Skip to main content

A simple and minimal static site generator.

Project description

vite

A simple and mnml static site generator that Just Works™

forthebadge forthebadge forthebadge forthebadge

Vite demo

Installation

$ pip install vite

Usage

$ vite init path/to/project
$ vite new blog/some-post.md   # `pages/` is implied

This creates pages/blog/some-post.md.

And then:

$ vite build   # in project directory

Rendered HTML will be in the build directory.

Finally, run:

$ vite serve  # also in the project 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
title: Some fancy buzzwords here
subtitle: Cool catch phrase here
date: 1 April, 2019
---

## 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)
  • More powerful frontmatter (title, date, draft status, etc.) (draft status is incomplete)
  • Deeper directories under pages/ (supports only one level now, breaks otherwise) (not happening)
  • Tagging system (not happening)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vite-1.5.0.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file vite-1.5.0.tar.gz.

File metadata

  • Download URL: vite-1.5.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for vite-1.5.0.tar.gz
Algorithm Hash digest
SHA256 3682d125fe307384c346c93d3736decb021904a256a1f0cf88de9bb636ebe51b
MD5 d0c5b36c4e9eb64c6ed9eb6cdad9b998
BLAKE2b-256 0eec3241fd6eb4864a6073095a51c052ecfba6c336509c59bfa120e00e883485

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page