From 864e058f009eb0416d86e9461726d3f97e956df9 Mon Sep 17 00:00:00 2001 From: Ashelyn Rose Date: Sat, 26 Apr 2025 21:55:30 -0600 Subject: allow doctype --- modules/site_test/src/main.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'modules/site_test/src/main.rs') diff --git a/modules/site_test/src/main.rs b/modules/site_test/src/main.rs index 9201c8a..b0fe9f3 100644 --- a/modules/site_test/src/main.rs +++ b/modules/site_test/src/main.rs @@ -3,7 +3,7 @@ use morgana::{morx, Component, RenderNode}; pub fn main() { let parent = morx! { ParentLayout { - Child { + Child some_prop={"something".to_string()} { "Hello world!" } } @@ -19,10 +19,13 @@ struct ParentLayout { impl Component for ParentLayout { fn render(self: Box) -> RenderNode { + let string = "test string"; + morx!{ + !doctype html; html lang = "en-US" { head { - title = "test thing" + title ={string} } body = {self.children} } @@ -31,13 +34,15 @@ impl Component for ParentLayout { } struct Child { - children: Vec + children: Vec, + some_prop: String, } impl Component for Child { fn render(self: Box) -> RenderNode { morx! { p= {self.children} + p= {self.some_prop} } } } -- cgit 1.4.1