Skip to content

Commit

Permalink
Use a thread-local buffer and a map of rendered pages for rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
grego committed Nov 7, 2022
1 parent 9c30736 commit e424803
Show file tree
Hide file tree
Showing 12 changed files with 445 additions and 414 deletions.
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blades"
version = "0.4.1"
version = "0.5.0-alpha"
authors = ["Maroš Grego <maros@grego.site>"]
edition = "2021"
description = "Blazing fast dead simple static site generator"
Expand All @@ -9,7 +9,7 @@ keywords = ["website", "site", "generator"]
categories = ["command-line-utilities", "web-programming"]
license = "GPL-3.0-or-later"
readme = "README.md"
homepage = "https://www.getblades.org"
homepage = "https://getblades.org"

[dependencies]
ramhorns = "0.14"
Expand All @@ -19,7 +19,6 @@ serde = { version = "^1.0.126", features = ["derive"] }
chrono = { version = "^0.4.19", features = ["std", "serde"], default_features = false }
fnv = "1.0"
hashbrown = { version = "0.12", features = ["inline-more", "serde"], default_features = false }
serde-cmd = "0.1.3"
pulldown-cmark = { version = "0.9", default_features = false }
cmark-syntax = "0.3"

Expand All @@ -29,16 +28,18 @@ clap = { version = "4", optional = true, default_features = false, features = ["
clap_derive = { version = "4", optional = true }
thiserror = { version = "1", optional = true }
serde_json = { version = "1", optional = true }
serde-cmd = { version = "0.1.3", optional = true }

[features]
bin = ["toml", "clap", "clap_derive", "thiserror", "serde_json"]
bin = ["toml", "clap", "clap_derive", "thiserror", "serde_json", "serde-cmd"]
mathml = ["cmark-syntax/latex2mathml"]
default = ["bin", "mathml"]

[profile.release]
lto = true
opt-level = 3
strip = "debuginfo"
#panic = "abort"
codegen-units = 1

[profile.bench]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ content using the provided templates.
Thanks to [zero-copy](https://serde.rs/lifetimes.html#borrowing-data-in-a-derived-impl) deserialization
and the [Ramhorns](https://github.com/maciejhirsz/ramhorns) templating engine,
it renders the whole site in milliseconds, possibly more than
[10 times](https://github.com/grego/ssg-bench) faster than other generators like Hugo.
[20 times](https://github.com/grego/ssg-bench) faster than other generators like Hugo.

It's made for easy setup and use. A static site generator should be a no brainer.
It uses [mustache](https://mustache.github.io/mustache.5.html) templates with extremely minimal
Expand Down
144 changes: 0 additions & 144 deletions src/config.rs

This file was deleted.

10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
//! the `bin` feature gate, which is enabled by default. When using Blades as a library, they are not
//! necessary, so it is recommended to import blades with `default_features = false`.
#![warn(missing_docs)]
mod config;
mod page;
mod render;
mod site;
mod sources;
mod tasks;
mod taxonomies;
mod types;

pub use config::Config;
pub use page::{Context, Page, Pages, Picture};
pub use render::render_meta;
pub use site::Site;
pub use sources::{Parser, Source, Sources};
pub use tasks::{cleanup, colocate_assets, load_templates, render_meta};
pub use taxonomies::{TaxonMeta, Taxonomies, Taxonomy};
pub use types::{Ancestors, Any, DateTime, HashMap, MutSet};
pub use types::{Ancestors, Any, DateTime, HashMap};
Loading

0 comments on commit e424803

Please sign in to comment.