Hauchiwa
Incredibly flexible static site generator library with incremental rebuilds and cached image optimization. This library can be used as the backbone of your own static site generator, it can handle all the mundane work for you:
- gathering content files from the file system
- optimizing images and caching the work
- compiling SCSS and CSS stylesheets
- compiling JavaScript applications via ESBuild
- watching for changes and incremental rebuilds
This library's API is purposefully designed to be small, simple, flexible and powerful.
Feature flags
[]
= [
"asyncrt", # add async runtime (tokio) and async loader
"styles", # add sass loader
"images", # add image loader + optimizer
"reload", # add live reload in watch mode
"server", # add http server for local development and writing in watch mode
]
Get started
To get started add the following snippet to your Cargo.toml file.
= "*" # change this version to the latest
Declarative configuration
The configuration API is designed to be extremely minimal, but powerful and flexible.
Here's a small sample of how you can use this library to create your own generator. Let's start by defining the shape of front matter for a single post stored as a Markdown file.
/// Represents a simple post, this is the metadata for your Markdown content.
The main.rs of your application can use clap to accept any additional CLI
arguments, such as mode.
use ;
In the main function of your application you can configure how the website should be generated.
The full documentation for this library is always available on docs.rs, please feel free to take a look at it 😊
License
This library is available under GPL 2.0 (or later).