Hasty Briefsbeta

Liquid-rust: Liquid templating for Rust

10 days ago
  • #Liquid
  • #Rust
  • #Templating
  • Liquid templating for Rust aims to be conformant with Shopify/liquid, flexible for different domains, and performant.
  • Example applications using liquid-rust include static site generators (cobalt, Mandy), crate tools (cargo-tarball, cargo-generate).
  • To include liquid in a Rust project, add `liquid` to Cargo.toml with `cargo add liquid`.
  • Basic usage involves parsing a template, setting globals, and rendering the output.
  • By default, liquid-rust has no filters, tags, or blocks; users can enable defaults or customize.
  • Creating custom filters involves implementing functions that process input and return a Value.
  • Tags require initialization and rendering logic, with examples provided in the documentation.
  • Blocks are similar to tags but contain additional markup, initialized with a list of inner elements.
  • The project is dual-licensed under Apache 2.0 and MIT licenses, with contributions under the same terms.