ProductPromotion
Logo

Rust

made by https://0x3d.site

GitHub - grego/blades: Blazing fast dead simple static site generator
Blazing fast dead simple static site generator. Contribute to grego/blades development by creating an account on GitHub.
Visit Site

GitHub - grego/blades: Blazing fast dead simple static site generator

GitHub - grego/blades: Blazing fast dead simple static site generator

Blades

Crates.io status Docs

blazing fast
 dead simple
  static site generator

User manual

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 20 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.

Features

  • Powerful plugin system
  • Themes
  • Image gallery generation
  • CommonMark markdown with tables and footnotes for content
  • Rendering of LaTeX formulas into MathML, (supported by all major browsers), with content between $ rendered in inline mode and content between $$ rendered in display mode.
  • Syntax highlighting using cmark-syntax
  • Customizable taxonomies (like categories or tags)
  • Pagination
  • Breadcrumbs
  • Asset colocation
  • Table of contents with access to all of the site data
  • Automatic sitemap, Atom and RSS feed generation

Why not blades?

Unlike other monolithic generators, Blades is modest in scope. All it does is to generate a site. It doesn't do any fancy stuff like transpiling Haskell to minified Javascript, or ever watching the site for changes. For that, you can use a dedicated tool like caretaker.

Nevertheless, if you have a feature request or ran into some issue using Blades, please submit an issue. Any contribution is welcome! :)

Why blades?

They shave the mustache off.

Installing

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 .

macOS

Using the package manager Homebrew

brew install blades

Using the package manager MacPorts

sudo port install blades

Running

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

Plugins

There are 4 types of plugins that can be used with Blades.

  • input - they put a JSON-serialised list of pages on the standard output, can be used to get pages from different sources
  • output - they receive a JSON-serialised list of pages on the standard input and can be used to generate further page data, such as processing images
  • transform - they receive a JSON-serialised list of pages on the standard output and output another such list on the standard output, can transform anything on the pages
  • content - they receive a markdown content of one page on standard input and output markdown on the standard output; they are enabled on per-page basis

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.

Example

Example plugin configuration can be found in examples, as well as an example toy transform plugin. To try it, first build the plugin:

cargo build --release transform_plugin

Then run Blades in the examples directory:

cargo run --release

For more on plugins, check their documentation and existing plugins

Themes

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 into the themes directory. A list of available themes can be found here.

To overwrite the theme, simply use the files in the templates, resp. assets subdirectories of the page root directory.

When initializing a Blades project with blades init, it provides an option to start with a minimal working template to allow you to quickly start working on your content.

Assets

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

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.

Meta

Blades renders sitemap (into sitemap.xml), Atom (into atom.xml) and RSS (into rss.xml) feeds, unless explicitly disabled in the config.

Using Blades as a library

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 serde::Deserialize. Currently, Cargo doesn't support binary-only dependencies. As such, these dependencies are behind the 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.

Contribution

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.

License

Blades is free software, and is released under the terms of the GNU General Public License version 3. See LICENSE.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory