Macro include_template_file

Source
macro_rules! include_template_file {
    ( $n:expr, $( $x:expr ),* ) => { ... };
}
Expand description

A macro loads handlebar files in default template with include_str! macro.

ยงExamples

// read file(s) from src/theme/blog/ dir
let v = nib::include_template_file!("blog", "layout");

assert_eq!(v.len(), 1);
assert_eq!(get_type(&v), "alloc::vec::Vec<(&str, &str)>");

let key = v[0].0;
let dat = v[0].1;

assert_eq!(key, "layout");
assert!(dat.starts_with("<!DOCTYPE html>\n"));