{"id":13478088,"url":"https://github.com/cobalt-org/liquid-rust","last_synced_at":"2025-05-13T21:11:07.911Z","repository":{"id":23037198,"uuid":"26390085","full_name":"cobalt-org/liquid-rust","owner":"cobalt-org","description":"Liquid templating for Rust","archived":false,"fork":false,"pushed_at":"2025-04-10T16:51:08.000Z","size":2587,"stargazers_count":507,"open_issues_count":86,"forks_count":79,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-28T14:09:09.957Z","etag":null,"topics":["liquid","rust","template-language"],"latest_commit_sha":null,"homepage":"docs.rs/liquid","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cobalt-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-11-09T08:29:49.000Z","updated_at":"2025-04-25T07:16:45.000Z","dependencies_parsed_at":"2023-01-14T13:20:00.669Z","dependency_job_id":"a3e2d71b-d2ed-44f7-8660-b2adf5088d56","html_url":"https://github.com/cobalt-org/liquid-rust","commit_stats":{"total_commits":1022,"total_committers":54,"mean_commits":"18.925925925925927","dds":0.7544031311154599,"last_synced_commit":"23dbef9df8d93600e5fa7b54a3a0648f8e0e567d"},"previous_names":[],"tags_count":269,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobalt-org%2Fliquid-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobalt-org%2Fliquid-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobalt-org%2Fliquid-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobalt-org%2Fliquid-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cobalt-org","download_url":"https://codeload.github.com/cobalt-org/liquid-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326839,"owners_count":21571636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["liquid","rust","template-language"],"created_at":"2024-07-31T16:01:52.284Z","updated_at":"2025-04-28T14:09:20.298Z","avatar_url":"https://github.com/cobalt-org.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"liquid-rust\n===========\n\n\u003e [Liquid templating](https://shopify.github.io/liquid/) for Rust\n\n[![Crates Status](https://img.shields.io/crates/v/liquid.svg)](https://crates.io/crates/liquid)\n\nGoals:\n1. Conformant. Incompatibilities with [strict shopify/liquid][shopify-liquid] are [bugs to be fixed][shopify-compat].\n2. Flexible. Liquid embraces [variants][liquid-variants] for different domains and we want to follow in that spirit.\n3. Performant. Do the best we can within what is conformant.\n\n[shopify-liquid]: https://github.com/Shopify/liquid\n[shopify-compat]: https://github.com/cobalt-org/liquid-rust/labels/shopify-compatibility\n[liquid-variants]: https://shopify.github.io/liquid/basics/variations/\n\nExample applications using liquid-rust:\n- [cobalt]: static site generator.\n- [cargo-tarball]: crate bin packaging tool.\n- [cargo-generate]: crate generator from templates.\n- [Mandy]: A hypersonic, easy-to-use, performant static-site generator.\n\n[cobalt]: https://cobalt-org.github.io/\n[cargo-tarball]: https://github.com/crate-ci/cargo-tarball\n[cargo-generate]: https://github.com/ashleygwilliams/cargo-generate\n[Mandy]: https://github.com/alyxshang/mandy\n\nUsage\n----------\n\nTo include liquid in your project add the following to your Cargo.toml:\n\n```console\n$ cargo add liquid\n```\n\nExample:\n\n```rust\nlet template = liquid::ParserBuilder::with_stdlib()\n    .build().unwrap()\n    .parse(\"Liquid! {{num | minus: 2}}\").unwrap();\n\nlet globals = liquid::object!({\n    \"num\": 4f64\n});\n\nlet output = template.render(\u0026globals).unwrap();\nassert_eq!(output, \"Liquid! 2\".to_string());\n```\n\nYou can find a reference on Liquid syntax [here](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers).\n\nCustomizing Liquid\n------------------\n\n### Language Variants\n\nBy default, `liquid-rust` has no filters, tags, or blocks.  You can enable the\ndefault set or pick and choose which to add to suite your application.\n\n### Create your own filters\n\nCreating your own filters is very easy. Filters are simply functions or\nclosures that take an input `Value` and a `Vec\u003cValue\u003e` of optional arguments\nand return a `Value` to be rendered or consumed by chained filters.\n\nSee\n[filters/](https://github.com/cobalt-org/liquid-rust/blob/master/crates/lib/src/stdlib/filters)\nfor what a filter implementation looks like.  You can then register it by\ncalling `liquid::ParserBuilder::filter`.\n\n### Create your own tags\n\nTags are made up of two parts, the initialization and the rendering.\n\nInitialization happens when the parser hits a Liquid tag that has your\ndesignated name. You will have to specify a function or closure that will\nthen return a `Renderable` object to do the rendering.\n\nSee\n[include_tag.rs](https://github.com/cobalt-org/liquid-rust/blob/master/crates/lib/src/stdlib/tags/include_tag.rs)\nfor what a tag implementation looks like.  You can then register it by calling `liquid::ParserBuilder::tag`.\n\n### Create your own tag blocks\n\nBlocks work very similar to Tags. The only difference is that blocks contain other\nmarkup, which is why block initialization functions take another argument, a list\nof `Element`s that are inside the specified block.\n\nSee\n[comment_block.rs](https://github.com/cobalt-org/liquid-rust/blob/master/crates/lib/src/stdlib/blocks/comment_block.rs)\nfor what a block implementation looks like.  You can then register it by\ncalling `liquid::ParserBuilder::block`.\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual-licensed as above, without any additional terms or\nconditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobalt-org%2Fliquid-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobalt-org%2Fliquid-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobalt-org%2Fliquid-rust/lists"}