diff --git a/CHANGELOG.md b/CHANGELOG.md index 093ef9b..4d4ded7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Add tables and footnotes support in markdown - Add previous/previous_in_section/next/next_in_section/summary to `Page` - Add more language syntaxes +- Only load templates ending by `.html` ## 0.0.3 (2017-04-05) - Add some colours in console diff --git a/README.md b/README.md index b57ab61..d747337 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you want to add some of your own variables, you will need to put them in the they will be silently ignored. ### Templates -Templates live in the `templates/` directory. +Templates live in the `templates/` directory and the files need to end by `.html`. Only [Tera](https://github.com/Keats/tera) templates are supported. Each kind of page get their own variables: diff --git a/src/site.rs b/src/site.rs index d82127e..74612ce 100644 --- a/src/site.rs +++ b/src/site.rs @@ -79,7 +79,7 @@ impl Site { pub fn new>(path: P, config_file: &str) -> Result { let path = path.as_ref(); - let tpl_glob = format!("{}/{}", path.to_string_lossy().replace("\\", "/"), "templates/**/*"); + let tpl_glob = format!("{}/{}", path.to_string_lossy().replace("\\", "/"), "templates/**/*.html"); let mut tera = Tera::new(&tpl_glob).chain_err(|| "Error parsing templates")?; tera.extend(&GUTENBERG_TERA)?; tera.register_filter("markdown", filters::markdown);