Browse Source

Revert useless change in shortcodes

index-subcmd
Vincent Prouillet 5 years ago
parent
commit
11c58458e8
3 changed files with 3 additions and 3 deletions
  1. +1
    -0
      .gitignore
  2. +1
    -3
      components/rendering/src/shortcode.rs
  3. +1
    -0
      components/site/benches/gen.py

+ 1
- 0
.gitignore 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


+ 1
- 3
components/rendering/src/shortcode.rs 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))?;


+ 1
- 0
components/site/benches/gen.py 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)


Loading…
Cancel
Save