From 6b3df91336b5194c4e96eb25fd2c4d850a44cf8f Mon Sep 17 00:00:00 2001 From: mwcz Date: Fri, 7 Jan 2022 13:41:12 -0500 Subject: [PATCH 1/2] add theme's robots.txt to tera with correct name --- components/templates/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/templates/src/lib.rs b/components/templates/src/lib.rs index 56cbd57563..af58705639 100644 --- a/components/templates/src/lib.rs +++ b/components/templates/src/lib.rs @@ -82,7 +82,10 @@ pub fn load_tera(path: &Path, config: &Config) -> Result { rewrite_theme_paths(&mut tera_theme, theme); if theme_path.join("templates").join("robots.txt").exists() { - tera_theme.add_template_file(theme_path.join("templates").join("robots.txt"), None)?; + tera_theme.add_template_file( + theme_path.join("templates").join("robots.txt"), + Some("robots.txt"), + )?; } tera.extend(&tera_theme)?; } From 8755a1ed1091ddef3e74204e527e488d565ac16b Mon Sep 17 00:00:00 2001 From: mwcz Date: Mon, 10 Jan 2022 13:17:57 -0500 Subject: [PATCH 2/2] add TODO reminder to add tests --- components/templates/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/components/templates/src/lib.rs b/components/templates/src/lib.rs index af58705639..7104e543aa 100644 --- a/components/templates/src/lib.rs +++ b/components/templates/src/lib.rs @@ -81,6 +81,7 @@ pub fn load_tera(path: &Path, config: &Config) -> Result { .map_err(|e| Error::chain("Error parsing templates from themes", e))?; rewrite_theme_paths(&mut tera_theme, theme); + // TODO: add tests for theme-provided robots.txt (https://github.com/getzola/zola/pull/1722) if theme_path.join("templates").join("robots.txt").exists() { tera_theme.add_template_file( theme_path.join("templates").join("robots.txt"),