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!"