diff --git a/components/library/src/content/ser.rs b/components/library/src/content/ser.rs index 83388d60..f5304849 100644 --- a/components/library/src/content/ser.rs +++ b/components/library/src/content/ser.rs @@ -5,7 +5,6 @@ use tera::{Map, Value}; use content::{Page, Section}; use library::Library; -use rendering::Header; #[derive(Clone, Debug, PartialEq, Serialize)] pub struct TranslatedContent<'a> { diff --git a/components/rebuild/tests/rebuild.rs b/components/rebuild/tests/rebuild.rs index 6bd69be1..621e8a8f 100644 --- a/components/rebuild/tests/rebuild.rs +++ b/components/rebuild/tests/rebuild.rs @@ -240,7 +240,6 @@ fn can_rebuild_after_renaming_non_md_asset_in_colocated_folder() { fn can_rebuild_after_deleting_file() { let tmp_dir = tempdir().expect("create temp dir"); let (site_path, mut site) = load_and_build_site!(tmp_dir, "test_site"); - println!("{:#?}", site.tera.templates.keys().collect::>()); let path = site_path.join("content").join("posts").join("fixed-slug.md"); fs::remove_file(&path).unwrap(); diff --git a/components/rendering/src/shortcode.rs b/components/rendering/src/shortcode.rs index 4bf7c691..0ef0488b 100644 --- a/components/rendering/src/shortcode.rs +++ b/components/rendering/src/shortcode.rs @@ -1,3 +1,5 @@ +use std::path::MAIN_SEPARATOR; + use pest::iterators::Pair; use pest::Parser; use regex::Regex; @@ -112,7 +114,7 @@ fn render_shortcode( } tera_context.extend(context.tera_context.clone()); - let template_name = format!("shortcodes/{}.html", name); + let template_name = format!("shortcodes{}{}.html", MAIN_SEPARATOR, name); let res = utils::templates::render_template(&template_name, &context.tera, tera_context, &None) .map_err(|e| Error::chain(format!("Failed to render {} shortcode", name), e))?;