diff --git a/components/templates/src/lib.rs b/components/templates/src/lib.rs index 04e7d1da3c..1053b4259d 100644 --- a/components/templates/src/lib.rs +++ b/components/templates/src/lib.rs @@ -45,7 +45,7 @@ pub fn render_redirect_template(url: &str, tera: &Tera) -> Result { pub fn load_tera(path: &Path, config: &Config) -> Result { let tpl_glob = - format!("{}/{}", path.to_string_lossy().replace('\\', "/"), "templates/**/*.{*ml,md}"); + format!("{}/{}", path.to_string_lossy().replace('\\', "/"), "templates/**/*.{*ml,md,txt}"); // Only parsing as we might be extending templates from themes and that would error // as we haven't loaded them yet diff --git a/docs/content/documentation/templates/robots.md b/docs/content/documentation/templates/robots.md index c93ff73bbb..98cb4374a8 100644 --- a/docs/content/documentation/templates/robots.md +++ b/docs/content/documentation/templates/robots.md @@ -15,3 +15,14 @@ Disallow: Allow: / Sitemap: {{/* get_url(path="sitemap.xml") */}} ``` + +The file can be extended & expanded like other templates using e.g. Tera's `include` tag: + +```jinja2 +User-agent: * +Disallow: +Allow: / +Sitemap: {{/* get_url(path="sitemap.xml") */}} + +{% include "path/to/other/robots.txt" %} +```