Crates.io | ssg |
lib.rs | ssg |
version | 0.0.30 |
source | src |
created_at | 2023-03-14 18:46:09.037949 |
updated_at | 2024-11-11 22:19:08.464089 |
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 |
size | 361,552 |
Shokunin Static Site Generator (SSG)
A Content-First Open Source Static Site Generator (SSG) crafted in Rust.
• Website • Documentation • Report Bug • Request Feature • Contributing Guidelines
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.
Shokunin generates sites that meet Web Content Accessibility Guidelines (WCAG) standards:
These accessibility features are automatically implemented in generated sites through:
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(())
}
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
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 |
For full API documentation, please visit https://docs.rs/crate/ssg/.
To explore more examples, clone the repository and run the following command:
cargo run --example example_name
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under either of
at your option.
Special thanks to all contributors who have helped build the ssg
library.