Crates.io | sitegen |
lib.rs | sitegen |
version | 0.0.1 |
source | src |
created_at | 2020-05-13 16:55:54.801931 |
updated_at | 2020-05-13 16:55:54.801931 |
description | Static site generator |
homepage | |
repository | https://github.com/noviga/sitegen/ |
max_upload_size | |
id | 241178 |
size | 8,624 |
SiteGen is the static site generator.
|-- static
| |-- css
| |-- fonts
| `-- img
`-- src
|-- css
| `-- main.scss
|-- pages
| |-- products
| | `-- first.hbs
| `-- index.hbs
|-- templates
| `-- layout.hbs
`-- main.rs
sitegen
to your Cargo.toml
: [dependencies]
sitegen = "0.0"
# or
sitegen = { git = "https://github.com/noviga/sitegen" }
fn main() {
let out_dir = "site";
sitegen::render_css(&out_dir, "main").unwrap();
sitegen::render_html(&out_dir, "index", "My Best Website").unwrap();
sitegen::render_html(&out_dir, "products/first", "First Product").unwrap();
sitegen::copy_static(&out_dir, "css").unwrap();
sitegen::copy_static(&out_dir, "fonts").unwrap();
sitegen::copy_static(&out_dir, "img").unwrap();
sitegen::write_cname(&out_dir, "my-best-website.com").unwrap();
}
site
directory: cargo run
Source code is licensed under MIT license.