From c2d0aea9d40d5b48c79e0c55317407dc858b45cd Mon Sep 17 00:00:00 2001 From: JesusPerez Date: Sun, 23 Jan 2022 11:04:38 +0000 Subject: [PATCH] chore: fix tera path conversion --- Cargo.toml | 2 +- src/tera_lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f98b8cc..e46a9eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "rtplfile" +name = "rtpldatafile" version = "0.1.0" authors = ["JesusPerez "] edition = "2021" diff --git a/src/tera_lib.rs b/src/tera_lib.rs index 8f9f7ff..cd38447 100644 --- a/src/tera_lib.rs +++ b/src/tera_lib.rs @@ -130,7 +130,7 @@ pub fn hash_from_data(path: &str, ctx: &mut tera::Context, data_hash: &mut HashM } } else if let Some(table_data) = data.as_table() { for (key, value) in table_data { - println!("-{}-{}",&key,&value); + // println!("-{}-{}",&key,&value); let val = get_toml_val(&value, "".into()); check_value(key.into(),val); } @@ -191,7 +191,7 @@ pub fn data_templated( } tera.add_raw_templates(all_tpls)?; let res = tera.render("data-template.html", &tpl_context)?; - Ok(res) + Ok(res.replace("/","/")) } /// Read a `file_name` from a path (root / `file_name`) ( "" `file_name_full_path` ) /// format of reading can be matched with `file_type`