blazing fast dead simple static site generator
Blades is made to do one job and do it well - generate HTML files from the provided
content using the provided templates.
Thanks to zero-copy deserialization and the Ramhorns templating engine, it renders the whole site in milliseconds, possibly more than 10 times faster than other generators like Hugo.
It's made for easy setup and use. A static site generator should be a no brainer. It uses mustache templates with extremely minimal and obvious syntax (like 7 rules!), providing the necessary building blocks to let you focus on your content.
Nevertheless, if you have a feature request or ran into some issue using Blades, please submit an
issue. Any contribution is welcome!
They shave the mustache off.
With the Rust toolchain installed, you can install Blades from crates.io
cargo install blades
Or from its repository
git clone https://github.com/grego/blades cd blades cargo install --path .
Using the package manager MacPorts
sudo port install blades
Then, you can run the executable
blades with the following subcommands:
init: Initialize the site in the current directory, creating the basic files and folders
build: Build the site according to config, content, templates and themes in the current directory
colocate: Move the assets from the "assets" directory and from the theme, if one is used, into the output directory
all: Build the site and colocate the assets
lazy: Build the site and (colocate assets only if the theme was switched) [default]
new: Create a new page
There are 4 types of plugins that can be used with Blades.
Any code in any language can be used, as only using the standard input and output is assumed. For Rust, Blades also provides a library for automatic serialisation and deserialisation pages.
git submodule update --init
Then build the plugin:
cargo build --release transform_plugin
Then run Blades in the
cargo run --release
When you specify a theme in the config, templates and assets from the theme are used.
Every site that doesn't use a theme can be used as a theme for another site.
Therefore, the easiest way to use a theme is to just clone the corresponding theme's repository
themes directory. A list of available themes can be found here.
To overwrite the theme, simply use the files in the
assets subdirectories of the
page root directory.
All the files from the
assets directory (and from the theme) are moved into the directory
specified in the config, which is emptied before. This is a subdirectory of the
output directory (defaults to
Blades takes of the pages it rendered before and if some of them is deleted, the corresponding files in the output directory will be deleted, too. The other files in the output directory are left intact. This way, you can place anything in the output directory and (as long as its name differs from all the page names and it's not in the assets subdirectory), Blades won't touch it.
Main components of Blades are also exported as a library. They are parser agnostic, so they can be used
to generate a website using any format that implements
Currently, Cargo doesn't support binary-only dependencies. As such, these dependencies are behind
bin feature gate, which is enabled by default. When using Blades as a library, they are not
necessary, so it is recommended to import blades with
default_features = false.
If you found a bug or would like to see some feature in Blades, you are the most welcome to submit an issue or a pull request! Likewise if you found something in this documentation not clear or imprecise.
Blades is free software, and is released under the terms of the GNU General Public License version 3. See LICENSE.