From 43db3a43ff80021d08af0f8894db5c2d422f4169 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Sun, 18 Mar 2018 09:34:37 +0100 Subject: [PATCH] Do not require themes to have a static folder --- CHANGELOG.md | 1 + components/site/src/lib.rs | 5 +---- .../documentation/getting-started/directory-structure.md | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb2650f..6d83091 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Sitemap entries are now sorted by permalinks to avoid random ordering - Preserve directory structure from sass folder when copying compiled css files to the public directory +- Do not require themes to have a static folder ## 0.3.2 (2018-03-05) diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index 2767ccc..a10fdae 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -92,14 +92,11 @@ impl Site { // Grab data from the extra section of the theme config.merge_with_theme(&path.join("themes").join(&theme).join("theme.toml"))?; - // Test that the {templates,static} folder exist for that theme + // Test that the templates folder exist for that theme let theme_path = path.join("themes").join(&theme); if !theme_path.join("templates").exists() { bail!("Theme `{}` is missing a templates folder", theme); } - if !theme_path.join("static").exists() { - bail!("Theme `{}` is missing a static folder", theme); - } let theme_tpl_glob = format!("{}/{}", path.to_string_lossy().replace("\\", "/"), "themes/**/*.html"); let mut tera_theme = Tera::parse(&theme_tpl_glob).chain_err(|| "Error parsing templates from themes")?; diff --git a/docs/content/documentation/getting-started/directory-structure.md b/docs/content/documentation/getting-started/directory-structure.md index 7ce266f..33006da 100644 --- a/docs/content/documentation/getting-started/directory-structure.md +++ b/docs/content/documentation/getting-started/directory-structure.md @@ -33,6 +33,8 @@ To learn more, read [the content overview](./documentation/content/overview.md). ## `sass` Contains the [Sass](http://sass-lang.com) files to be compiled. Non-Sass files will be ignored. +The directory structure of the `sass` folder will be preserved when copying over the compiled files: a file at +`sass/something/site.scss` will be compiled to `public/something/site.css`. ## `static` Contains any kind of files. All the files/folders in the `static` folder will be copied as-is in the output directory.