Revert useless change in shortcodes

This commit is contained in:
Vincent Prouillet 2019-02-22 21:02:42 +01:00
parent 84f10f6b69
commit 11c58458e8
3 changed files with 3 additions and 3 deletions

1
.gitignore vendored
View file

@ -8,6 +8,7 @@ small-blog
medium-blog medium-blog
big-blog big-blog
huge-blog huge-blog
extra-huge-blog
small-kb small-kb
medium-kb medium-kb
huge-kb huge-kb

View file

@ -1,5 +1,3 @@
use std::path::MAIN_SEPARATOR;
use pest::iterators::Pair; use pest::iterators::Pair;
use pest::Parser; use pest::Parser;
use regex::Regex; use regex::Regex;
@ -114,7 +112,7 @@ fn render_shortcode(
} }
tera_context.extend(context.tera_context.clone()); tera_context.extend(context.tera_context.clone());
let template_name = format!("shortcodes{}{}.html", MAIN_SEPARATOR, name); let template_name = format!("shortcodes/{}.html", name);
let res = utils::templates::render_template(&template_name, &context.tera, tera_context, &None) 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))?; .map_err(|e| Error::chain(format!("Failed to render {} shortcode", name), e))?;

View file

@ -169,6 +169,7 @@ if __name__ == "__main__":
gen_site("medium-blog", [""], 250, is_blog=True) gen_site("medium-blog", [""], 250, is_blog=True)
gen_site("big-blog", [""], 1000, is_blog=True) gen_site("big-blog", [""], 1000, is_blog=True)
gen_site("huge-blog", [""], 10000, is_blog=True) gen_site("huge-blog", [""], 10000, is_blog=True)
gen_site("extra-huge-blog", [""], 100000, is_blog=True)
gen_site("small-kb", ["help", "help1", "help2", "help3", "help4", "help5", "help6", "help7", "help8", "help9"], 10) gen_site("small-kb", ["help", "help1", "help2", "help3", "help4", "help5", "help6", "help7", "help8", "help9"], 10)
gen_site("medium-kb", ["help", "help1", "help2", "help3", "help4", "help5", "help6", "help7", "help8", "help9"], 100) gen_site("medium-kb", ["help", "help1", "help2", "help3", "help4", "help5", "help6", "help7", "help8", "help9"], 100)