forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build-templated-pages): remove unused tera dependencies
This involves toggling off Tera's default features so crates such as rand are not pulled in. The only thing I had to do was recreate the slugify filter, since that is used in a template.
- Loading branch information
Showing
4 changed files
with
25 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use std::collections::HashMap; | ||
|
||
use tera::{to_value, try_get_value, Result, Value}; | ||
|
||
// A copy-and-paste from Tera. It is the only builtin we use. | ||
// https://github.com/Keats/tera/blob/290889e61e9fda317f42f284e7a875342424d646/src/builtins/filters/string.rs#L240-L243 | ||
pub(crate) fn slugify(value: &Value, _: &HashMap<String, Value>) -> Result<Value> { | ||
let s = try_get_value!("slugify", "value", String, value); | ||
Ok(to_value(slug::slugify(s)).unwrap()) | ||
} |