use std::fs::File;
use std::io::Read;
use std::path::PathBuf;
pub struct TemplateSchema {
pub content: String,
pub shortened: String,
pub domain: String,
pub count: String
}
pub fn read_and_apply_templates(path: PathBuf, schema: TemplateSchema) -> String {
let mut file = File::open(path).unwrap();
let mut contents = String::new();
file.read_to_string(&mut contents).unwrap();
contents
.replace("{{content}}", &schema.content)
.replace("{{shortened}}", &schema.shortened)
.replace("{{domain}}", &schema.domain)
.replace("{{count}}", &schema.count)
}