New button template
This commit is contained in:
@@ -10,6 +10,7 @@ use crate::version::ANVIL_VERSION;
|
||||
// Embedded template directories
|
||||
static BASIC_TEMPLATE: Dir = include_dir!("$CARGO_MANIFEST_DIR/templates/basic");
|
||||
static WEATHER_TEMPLATE: Dir = include_dir!("$CARGO_MANIFEST_DIR/templates/weather");
|
||||
static BUTTON_TEMPLATE: Dir = include_dir!("$CARGO_MANIFEST_DIR/templates/button");
|
||||
|
||||
/// Context variables available in .tmpl files via {{VAR}} substitution.
|
||||
pub struct TemplateContext {
|
||||
@@ -106,13 +107,17 @@ fn template_dir(name: &str) -> Option<&'static Dir<'static>> {
|
||||
match name {
|
||||
"basic" => Some(&BASIC_TEMPLATE),
|
||||
"weather" => Some(&WEATHER_TEMPLATE),
|
||||
"button" => Some(&BUTTON_TEMPLATE),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
// All composed templates (everything except "basic").
|
||||
fn composed_template_entries() -> Vec<(&'static str, &'static Dir<'static>)> {
|
||||
vec![("weather", &WEATHER_TEMPLATE)]
|
||||
vec![
|
||||
("weather", &WEATHER_TEMPLATE),
|
||||
("button", &BUTTON_TEMPLATE),
|
||||
]
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
|
||||
Reference in New Issue
Block a user