Skip to content

Commit 243702e

Browse files
committed
Update tera
1 parent 6149fd1 commit 243702e

File tree

10 files changed

+200
-197
lines changed

10 files changed

+200
-197
lines changed

Cargo.lock

Lines changed: 188 additions & 185 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/errors/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Vincent Prouillet <[email protected]>"]
55

66
[dependencies]
7-
tera = "1.0.0-beta.10"
7+
tera = "1.0.0-beta.17"
88
toml = "0.5"
99
image = "0.22"
1010
syntect = "=3.2.0"

components/front_matter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Vincent Prouillet <[email protected]>"]
55

66
[dependencies]
7-
tera = "1.0.0-beta.10"
7+
tera = "1.0.0-beta.17"
88
chrono = "0.4"
99
serde = "1"
1010
serde_derive = "1"

components/imageproc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["Vojtěch Král <[email protected]>"]
66
[dependencies]
77
lazy_static = "1"
88
regex = "1.0"
9-
tera = "1.0.0-beta.10"
9+
tera = "1.0.0-beta.17"
1010
image = "0.22"
1111
rayon = "1"
1212

components/library/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = ["Vincent Prouillet <[email protected]>"]
77
slotmap = "0.4"
88
rayon = "1"
99
chrono = { version = "0.4", features = ["serde"] }
10-
tera = "1.0.0-beta.10"
10+
tera = "1.0.0-beta.17"
1111
serde = "1"
1212
serde_derive = "1"
1313
slug = "0.1"

components/site/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Vincent Prouillet <[email protected]>"]
55

66
[dependencies]
7-
tera = "1.0.0-beta.10"
7+
tera = "1.0.0-beta.17"
88
glob = "0.3"
99
rayon = "1"
1010
serde = "1"

components/templates/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Vincent Prouillet <[email protected]>"]
55

66
[dependencies]
7-
tera = "1.0.0-beta.10"
7+
tera = "1.0.0-beta.17"
88
base64 = "0.10"
99
lazy_static = "1"
1010
pulldown-cmark = "0.6"

components/templates/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ pub fn render_redirect_template(url: &str, tera: &Tera) -> Result<String> {
6969
let mut context = Context::new();
7070
context.insert("url", &url);
7171

72-
tera.render("internal/alias.html", context)
72+
tera.render("internal/alias.html", &context)
7373
.map_err(|e| Error::chain(format!("Failed to render alias for '{}'", url), e))
7474
}

components/utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Vincent Prouillet <[email protected]>"]
55

66
[dependencies]
77
errors = { path = "../errors" }
8-
tera = "1.0.0-beta.10"
8+
tera = "1.0.0-beta.17"
99
unicode-segmentation = "1.2"
1010
walkdir = "2"
1111
toml = "0.5"

components/utils/src/templates.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ macro_rules! render_default_tpl {
1111
let mut context = Context::new();
1212
context.insert("filename", $filename);
1313
context.insert("url", $url);
14-
Tera::one_off(DEFAULT_TPL, context, true).map_err(std::convert::Into::into)
14+
Tera::one_off(DEFAULT_TPL, &context, true).map_err(std::convert::Into::into)
1515
}};
1616
}
1717

@@ -27,21 +27,21 @@ pub fn render_template(
2727
) -> Result<String> {
2828
// check if it is in the templates
2929
if tera.templates.contains_key(name) {
30-
return tera.render(name, context).map_err(std::convert::Into::into);
30+
return tera.render(name, &context).map_err(std::convert::Into::into);
3131
}
3232

3333
// check if it is part of a theme
3434
if let Some(ref t) = *theme {
3535
let theme_template_name = format!("{}/templates/{}", t, name);
3636
if tera.templates.contains_key(&theme_template_name) {
37-
return tera.render(&theme_template_name, context).map_err(std::convert::Into::into);
37+
return tera.render(&theme_template_name, &context).map_err(std::convert::Into::into);
3838
}
3939
}
4040

4141
// check if it is part of ZOLA_TERA defaults
4242
let default_name = format!("__zola_builtins/{}", name);
4343
if tera.templates.contains_key(&default_name) {
44-
return tera.render(&default_name, context).map_err(std::convert::Into::into);
44+
return tera.render(&default_name, &context).map_err(std::convert::Into::into);
4545
}
4646

4747
// maybe it's a default one?

0 commit comments

Comments
 (0)