Skip to content

A Content-First Open Source Static Site Generator (SSG) written in Rust πŸ¦€

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

sebastienrousseau/shokunin

NucleusFlow logo

Shokunin Static Site Generator (SSG)

A Content-First Open Source Static Site Generator (SSG) crafted in Rust.

Made With Love Crates.io lib.rs Docs.rs Codecov Build Status GitHub

β€’ Website β€’ Documentation β€’ Report Bug β€’ Request Feature β€’ Contributing Guidelines

Overview

Shokunin is a lightning-fast static site generator (SSG) optimised for search engine visibility (SEO) and compliant with WCAG 2.1 Level AA accessibility standards.

Features

  • ⚑ Blazing Fast Performance: Built in Rust for optimal speed and efficiency
  • πŸ“± SEO Optimised: Built-in features for maximum search engine visibility
  • πŸ› οΈ Multiple Content Formats: Support for Markdown, YAML, JSON, and TOML
  • πŸ“Š Analytics Ready: Built-in support for Google Analytics and Bing Analytics
  • πŸ”„ Automated Feeds: Automatic generation of Atom and RSS feeds
  • 🎨 Flexible Theming: Compatible with custom HTML themes and templates
  • πŸ“± Development Server: Built-in Rust server for local testing

Accessibility Compliance

Shokunin generates sites that meet Web Content Accessibility Guidelines (WCAG) standards:

  • WCAG 2.1 Level AA compliance
  • Accessible Rich Internet Applications (ARIA) support
  • Semantic HTML structure
  • Keyboard navigation support
  • Screen reader compatibility
  • Sufficient color contrast
  • Responsive text scaling
  • Alternative text for images
  • Clear document structure
  • Focus management

These accessibility features are automatically implemented in generated sites through:

  • Semantic HTML templates
  • ARIA landmark roles
  • Proper heading hierarchy
  • Skip navigation links
  • Form input labels
  • Keyboard focus indicators
  • Color contrast validation

Installation

Add Shokunin to your Rust project:

# Cargo.toml
[dependencies]
shokunin = "0.0.30"

Basic implementation:

use staticdatagen::compiler::service::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("build");
    let content_path = Path::new("content");
    let site_path = Path::new("public");
    let template_path = Path::new("templates");

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

    Ok(())
}

Usage

Create a new static site:

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

Or use the short form:

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

Command-Line Options

Option Short Description Required
--new -n New site directory name Yes
--content -c Content directory path Yes
--template -t Template directory path Yes
--output -o Output directory path Yes
--serve -s Development server directory No

Documentation

For full API documentation, please visit https://docs.rs/crate/ssg/.

Examples

To explore more examples, clone the repository and run the following command:

cargo run --example example_name

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under either of

at your option.

Acknowledgements

Special thanks to all contributors who have helped build the ssg library.