Skip to content

Commit 3caf441

Browse files
authored
add theme's robots.txt to tera with name "robots.txt" (getzola#1722)
* add theme's robots.txt to tera with correct name * add TODO reminder to add tests
1 parent 361e093 commit 3caf441

File tree

1 file changed

+5
-1
lines changed
  • components/templates/src

1 file changed

+5
-1
lines changed

components/templates/src/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ pub fn load_tera(path: &Path, config: &Config) -> Result<Tera> {
8181
.map_err(|e| Error::chain("Error parsing templates from themes", e))?;
8282
rewrite_theme_paths(&mut tera_theme, theme);
8383

84+
// TODO: add tests for theme-provided robots.txt (https://github.com/getzola/zola/pull/1722)
8485
if theme_path.join("templates").join("robots.txt").exists() {
85-
tera_theme.add_template_file(theme_path.join("templates").join("robots.txt"), None)?;
86+
tera_theme.add_template_file(
87+
theme_path.join("templates").join("robots.txt"),
88+
Some("robots.txt"),
89+
)?;
8690
}
8791
tera.extend(&tera_theme)?;
8892
}

0 commit comments

Comments
 (0)