From 760130ccc2159c67aa1f29a1896f6b6c2cdfbfce Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Sun, 14 Jul 2024 09:07:53 -0700 Subject: [PATCH] Added more core components --- components/bulma/card.templ | 32 ++++++++++++++++++++++++++- components/bulma/example/layout.templ | 1 - components/bulma/html/img.templ | 9 ++++++++ components/bulma/image.templ | 10 +++++++++ components/bulma/layout/section.templ | 2 +- 5 files changed, 51 insertions(+), 3 deletions(-) delete mode 100644 components/bulma/example/layout.templ create mode 100644 components/bulma/html/img.templ create mode 100644 components/bulma/image.templ diff --git a/components/bulma/card.templ b/components/bulma/card.templ index 9b226a2..402b1dd 100644 --- a/components/bulma/card.templ +++ b/components/bulma/card.templ @@ -14,9 +14,39 @@ templ ArticleCardWithThumbnail(title, thumbnailUrl, url, datePosted, sourceName
- { datePosted }
+ { datePosted } +
{ sourceName }
} + +// Creates a card container. +// Accepts children +templ Card() { +
+ { children... } +
+} + +// Creates a image card container. +// Accepts children +templ CardImage() { +
+ { children... } +
+} + +// +templ CardImageSize(size string) { +
+ { children... } +
+} + +templ CardContentContainer() { +
+ { children... } +
+} diff --git a/components/bulma/example/layout.templ b/components/bulma/example/layout.templ deleted file mode 100644 index f7ec372..0000000 --- a/components/bulma/example/layout.templ +++ /dev/null @@ -1 +0,0 @@ -package example diff --git a/components/bulma/html/img.templ b/components/bulma/html/img.templ new file mode 100644 index 0000000..4de354b --- /dev/null +++ b/components/bulma/html/img.templ @@ -0,0 +1,9 @@ +package html + +templ Img(src string) { + +} + +templ ImgAlt(src, alt string) { + { +} \ No newline at end of file diff --git a/components/bulma/image.templ b/components/bulma/image.templ new file mode 100644 index 0000000..94cc76e --- /dev/null +++ b/components/bulma/image.templ @@ -0,0 +1,10 @@ +package bulma + +// Creates a image wrapper. +// This accepts children. +// Use html.Img() to load a image as a child +templ Image(image string) { +
+ { children... } +
+} \ No newline at end of file diff --git a/components/bulma/layout/section.templ b/components/bulma/layout/section.templ index 4775db4..a25bef5 100644 --- a/components/bulma/layout/section.templ +++ b/components/bulma/layout/section.templ @@ -1,4 +1,4 @@ -package bulma +package layout // Creates a
object thats good to break up a page of content. templ Section(title, subtitle string) {