From b3015929a42cbc2ffec695b6f7600654478254b4 Mon Sep 17 00:00:00 2001 From: Olivier Date: Sat, 4 Mar 2023 11:06:24 +0000 Subject: [PATCH] Demonstrate components, slots and parameters in the demo --- .../templates/components/TestComponent.hnb | 5 +++++ demo_hornbeam_project/templates/pages/say_hello.hnb | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 demo_hornbeam_project/templates/components/TestComponent.hnb diff --git a/demo_hornbeam_project/templates/components/TestComponent.hnb b/demo_hornbeam_project/templates/components/TestComponent.hnb new file mode 100644 index 0000000..297f1f7 --- /dev/null +++ b/demo_hornbeam_project/templates/components/TestComponent.hnb @@ -0,0 +1,5 @@ +div {style = "padding: 3em; background-color: #8eb; margin: 1em;"} + h1 + optional slot :title + div {style = "padding: ${$padding}em; background-color: #eb8;"} + slot :main diff --git a/demo_hornbeam_project/templates/pages/say_hello.hnb b/demo_hornbeam_project/templates/pages/say_hello.hnb index e899198..407dec6 100644 --- a/demo_hornbeam_project/templates/pages/say_hello.hnb +++ b/demo_hornbeam_project/templates/pages/say_hello.hnb @@ -6,3 +6,12 @@ html body h1 @hello{$name} + TestComponent {padding=1} + :title + "Title slot" + :main + "Main slot" + + hr + TestComponent {padding=4} + "No title slot on this one!"