mirror of
https://github.com/getzola/zola
synced 2024-11-10 14:24:27 +00:00
add theme's robots.txt to tera with name "robots.txt" (#1722)
* add theme's robots.txt to tera with correct name * add TODO reminder to add tests
This commit is contained in:
parent
faec345e84
commit
78132a8d1d
1 changed files with 5 additions and 1 deletions
|
@ -81,8 +81,12 @@ pub fn load_tera(path: &Path, config: &Config) -> Result<Tera> {
|
|||
.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"), None)?;
|
||||
tera_theme.add_template_file(
|
||||
theme_path.join("templates").join("robots.txt"),
|
||||
Some("robots.txt"),
|
||||
)?;
|
||||
}
|
||||
tera.extend(&tera_theme)?;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue