Fix robots.txt template for real this time
This commit is contained in:
parent
99215a4523
commit
2cf99c3cfc
|
@ -122,7 +122,7 @@ impl Site {
|
|||
// TODO: Tera doesn't use globset right now so we can load the robots.txt as part
|
||||
// of the glob above, therefore we load it manually if it exists.
|
||||
if path.join("templates").join("robots.txt").exists() {
|
||||
tera.add_template_file(path.join("templates").join("robots.txt"), None)?;
|
||||
tera.add_template_file(path.join("templates").join("robots.txt"), Some("robots.txt"))?;
|
||||
}
|
||||
|
||||
let content_path = path.join("content");
|
||||
|
|
|
@ -167,7 +167,7 @@ fn can_build_site_without_live_reload() {
|
|||
assert!(!file_contains!(public, "sitemap.xml", "draft"));
|
||||
|
||||
// robots.txt has been rendered from the template
|
||||
assert!(!file_contains!(public, "robots.txt", "Hello"));
|
||||
assert!(file_contains!(public, "robots.txt", "User-agent: gutenberg"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
Hello
|
||||
User-agent: gutenberg
|
||||
Allow: /
|
||||
|
|
Loading…
Reference in a new issue