shokunin
v0.0.32
Generator situs statis konten pertama yang dibuat di Rust, dioptimalkan untuk kinerja, aksesibilitas, dan visibilitas mesin pencari.
• Situs Web • Dokumentasi • Laporan Bug • Fitur Permintaan • Pedoman Berkontribusi
Shokunin adalah generator situs statis (SSG) berkinerja tinggi yang dirancang di Rust yang memprioritaskan:
Tambahkan ke Cargo.toml
Anda :
[ dependencies ]
ssg = " 0.0.32 "
Atau instal melalui 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 ( ( ) )
}
Buat situs baru:
# 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 "
Pilihan | Pendek | Keterangan | Diperlukan |
---|---|---|---|
--content | -c | Jalur konten | Ya |
--template | -t | Jalur templat | Ya |
--serve | -s | Jalur Publik Server | Ya |
Coba contoh penerapan kami:
# 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
Kami menyambut kontribusi! Silakan lihat Pedoman Berkontribusi kami untuk rincian tentang:
Proyek ini memiliki lisensi ganda di bawah:
sesuai pilihan Anda.
Terima kasih khusus kepada seluruh kontributor yang telah membantu membangun Shokunin.