Browse Source

Do not require themes to have a static folder

index-subcmd
Vincent Prouillet 6 years ago
parent
commit
43db3a43ff
3 changed files with 4 additions and 4 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -4
      components/site/src/lib.rs
  3. +2
    -0
      docs/content/documentation/getting-started/directory-structure.md

+ 1
- 0
CHANGELOG.md View File

@@ -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)



+ 1
- 4
components/site/src/lib.rs View File

@@ -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")?;


+ 2
- 0
docs/content/documentation/getting-started/directory-structure.md View File

@@ -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.


Loading…
Cancel
Save