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

Credits

Logo credits: Freepik from www.flaticon.com is licensed by CC 3.0 BY
Hue: s0md3v/hue

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vite-1.3.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file vite-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: vite-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6+

File hashes

Hashes for vite-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2e759a5158c5536efcb918a829eef33d2aad1f5397beac6e6ab8ff1a3dd03ccf
MD5 4e60593d97e6ac0342ad6113ab1c63e7
BLAKE2b-256 ec06386b279f4b5aad026ae0c7852ca12a0479e5e9199aceb6b42e3643246110

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