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