Crates.io | ssg |
lib.rs | ssg |
version | |
source | src |
created_at | 2023-03-14 18:46:09.037949 |
updated_at | 2025-01-01 14:41:43.327292 |
description | A Content-First Open Source Static Site Generator (SSG) crafted in Rust. |
homepage | https://shokunin.one |
repository | https://github.com/sebastienrousseau/shokunin |
max_upload_size | |
id | 810072 |
Cargo.toml error: | TOML parse error at line 39, column 1 | 39 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A content-first static site generator crafted in Rust, optimized for performance, accessibility, and search engine visibility.
• Website • Documentation • Report Bug • Request Feature • Contributing Guidelines
Shokunin is a high-performance static site generator (SSG) engineered in Rust that prioritises:
Add to your Cargo.toml
:
[dependencies]
ssg = "0.0.32"
Or install via Cargo:
cargo install ssg
use staticdatagen::compiler::service::compile;
use std::{path::Path, error::Error};
fn main() -> Result<(), Box<dyn Error>> {
// Define directory paths
let build_dir = Path::new("./examples/build"); // Build directory
let content_dir = Path::new("./examples/content"); // Content directory
let public_dir = Path::new("./examples/public"); // Public directory
let template_dir = Path::new("./examples/templates"); // Templates
// Generate site
compile(build_dir, content_dir, public_dir, template_dir)?;
println!("✨ Site generated successfully!");
Ok(())
}
Create a new site:
# Full command syntax
ssg --content=content --template=templates --serve=public
# Short form
ssg -c=content -t=templates -o=output -s=public
# Using cargo run
cargo run --bin ssg -- -c="./examples/content" -t="./examples/templates" -s="./examples/public"
Option | Short | Description | Required |
---|---|---|---|
--content |
-c |
Content path | Yes |
--template |
-t |
Template path | Yes |
--serve |
-s |
Server Public path | Yes |
Try our example implementations:
# Basic example
## Convert Markdown to static sites effortlessly, with templates, organized builds, and instant local hosting.
git clone https://github.com/sebastienrousseau/shokunin.git
cd shokunin
cargo run --example basic
# Quick start example
## Create, compile, and host a static site effortlessly with Shokunin: simple setup, error handling, and instant local server for previews.
cargo run --example quickstart
# Multilingual example
## Build multilingual static sites effortlessly: generate language-specific sites, create a language selector, and serve all from a single directory.
cargo run --example multilingual
We welcome contributions! Please see our Contributing Guidelines for details on:
This project is dual-licensed under:
at your option.
Special thanks to all contributors who have helped build Shokunin.