-
Notifications
You must be signed in to change notification settings - Fork 46
Home
wok is a static website generator. It turns a pile of templates, content, and resources (like CSS and images) into a neat stack of plain HTML.
The idea is that you don't need a big server-side engine like PHP to generate every page every visit: you can generate them all ahead of time, and only regenerate things when something has changed. A good way this could be done would be with a post-commit hook on a git repository containing your content or layout.
I made wok because projects like Jekyll, Hyde, and Static were intriguing, but in the end didn't quite match what I wanted to do with my website. So I am writing my own.
- Processes content and templates, and renders them to a set of pure HTML.
- Provides tagging and a hierarchical category system for organizing pages.
- Handles all kinds of media and other site resources (like images, CSS, JavaScript files, etc.) automatically.
- Includes a simple development server.
- Only regenerates pages that need it.
- Support for more markup languages (next up: ???)
[Content] is written as Markdown formatted text (parsed with Python Markdown) with a YAML header, separated by 3 hyphens alone on a line. For example
title: Sample Post
author: Mike Cooper <[email protected]>
---
The content of the page.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
pellentesque, est non hendrerit mattis, arcu nibh venenatis sapien, quis
porta sem libero placerat magna. Suspendisse condimentum turpis fringilla
ligula porta vestibulum et ut sem. Cras hendrerit pulvinar metus at
imperdiet.
This content is then rendered using Jinja2 templates. Wok looks for $templatename.html
in
the templates directory. Various variables relating to the site and the current page are provided to the template system.
For more info, see [Templates].
Any files in the media directory will be copied to the output directory. If a file is generated that has a file name conflict, it will overwrite the media file.
This feature is useful for images, css, javascript, etc.
Settings can be changed in the file config
in the current directory.
Possible configuration options (and their defaults) are
- output_dir ('output') - Where the outputted files are put.
- content_dir ('content') - Where to find the content.
- templates_dir ('templates') - Where the templates are.
- media_dir ('media') - Where the media files are copied from.
- site_title ('Some Random Wok Site')