diff --git a/src/main.rs b/src/main.rs index d1ea0b9..a43f1ac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,12 +9,14 @@ use rocket_contrib::templates::Template; #[derive(Serialize)] struct TemplateContext { parent: &'static str, + users: Vec<&'static str>, } #[get("/")] fn index() -> Template { let template_context = TemplateContext { parent: "layout", + users: vec!["foo", "bar", "car"], }; Template::render("index", &template_context) diff --git a/templates/index.html.hbs b/templates/index.html.hbs index befcb3e..cff8b52 100644 --- a/templates/index.html.hbs +++ b/templates/index.html.hbs @@ -1,6 +1,12 @@ {{#*inline "page"}} -

Hello, World!

+

Users

+ + {{/inline}} {{~> (parent)~}}