Shokunin Installation Prerequisites: Get the Fastest SSG

Install Shokunin on macOS, Linux, Windows, and leverage its simplicity and power to create static websites, blogs and microsites with ease.

Divider

Installation

It takes just a few minutes to get up and running with Shokunin Static Site Generator (SSG).

To install Shokunin Static Site Generator (SSG), you need to have the Rust toolchain installed on your machine. You can install the Rust toolchain by following the instructions on the Rust website.

Once you have the Rust toolchain installed, you can install Shokunin Static Site Generator (SSG) using the following command:

cargo install ssg

For simplicity, we have given Shokunin Static Site Generator (SSG) a simple alias ssg which can stand for Shokunin Site Generator or Static Site Generator.

You can then run the help command to see the available options and commands:

ssg --help

Requirements

The minimum supported Rust toolchain version is currently Rust 1.72.0 or later (stable). It is recommended that you install the latest stable version of Rust.

Platform support

Shokunin Static Site Generator (SSG) is supported and tested on the following platforms and architectures as part of our CI/CD pipeline.

This list is based on the Rust Platform Support list.

Tier 1 platforms

Rust Tier 1 targets are officially supported and guaranteed to work.

Operating System Target Description
βœ… Linux aarch64-unknown-linux-gnu 64-bit Linux systems on ARM architecture
βœ… Linux i686-unknown-linux-gnu 32-bit Linux (kernel 3.2+, glibc 2.17+)
βœ… Linux x86_64-unknown-linux-gnu 64-bit Linux (kernel 2.6.32+, glibc 2.11+)
βœ… macOS x86_64-apple-darwin 64-bit macOS (10.7 Lion or later)
βœ… Windows i686-pc-windows-gnu 32-bit Windows (7 or later)
βœ… Windows i686-pc-windows-msvc 32-bit Windows (7 or later)
βœ… Windows x86_64-pc-windows-gnu 64-bit Windows (7 or later)
βœ… Windows x86_64-pc-windows-msvc 64-bit Windows (7 or later)

Tier 2 platforms

Rust Tier 2 targets are supported for building, but not necessarily running.

Operating System Target Description
βœ… Linux aarch64-unknown-linux-musl 64-bit Linux systems on ARM architecture
βœ… Linux arm-unknown-linux-gnueabi ARMv6 Linux (kernel 3.2, glibc 2.17)
βœ… Linux arm-unknown-linux-gnueabihf ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17)
βœ… Linux armv7-unknown-linux-gnueabihf ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17)
βœ… macOS aarch64-apple-darwin 64-bit macOS (10.7 Lion or later)
βœ… Windows aarch64-pc-windows-msvc 64-bit Windows (7 or later)

The GitHub Actions shows the platforms in which the Shokunin Static Site Generator (SSG) library tests are run.

Documentation

Info: You can find our documentation on docs.rs, lib.rs and crates.io.

Usage

Command Line Interface (CLI)

The Shokunin Static Site Generator (SSG) library runs in a Terminal window and can be used to generate a static website.

Here’s the first command you can enter in your Terminal window to run Shokunin Static Site Generator (SSG):

ssg  --new=docs --content=content --template=template --output=output --serve=public

or

ssg  -n=docs -c=content -t=template -o=output -s=public

This command will create a new website with the name docs in the current directory. It will use the content directory to gather the website content and the template directory to generate the website files. It will serve the website directly from the docs directory.

Arguments

In your project

To use the Shokunin Static Site Generator (SSG) library in your project, add the following to your Cargo.toml file:

[dependencies]
shokunin = "0.0.20"

Add the following to your main.rs file:

extern crate ssg;
use ssg::*;

then you can use the Shokunin Static Site Generator (SSG) functions in your application code.

Examples

To get started with Shokunin Static Site Generator (SSG), you can use the examples provided in the examples directory of the project.

To run the examples, clone the repository and run the following command in your terminal from the project root directory.

cargo run --example example

The command will generate a static website based on the configuration details in the examples directory.

use ssg::compiler::compile;
use std::path::Path;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Define the paths to the build, site, content and template directories.
    let build_path = Path::new("examples/example.com/build");
    let content_path = Path::new("examples/example.com/content");
    let site_path = Path::new("examples/example.com/public");
    let template_path = Path::new("examples/example.com/template");

    compile(build_path, content_path, site_path, template_path)?;

    Ok(())
}

The main() function in this code compiles a website from the content directory, using the template directory to generate the website files. The compiled website is saved in the build directory and served directly from the example.com directory.

Args

Quick Start

You are now ready to use Shokunin and create amazing websites!