Added more core components

This commit is contained in:
James Tombleson 2024-07-14 09:07:53 -07:00
parent ad3756d27d
commit 760130ccc2
5 changed files with 51 additions and 3 deletions

View File

@ -14,9 +14,39 @@ templ ArticleCardWithThumbnail(title, thumbnailUrl, url, datePosted, sourceName
</div>
</div>
<div class="content">
{ datePosted }<br/>
{ datePosted }
<br/>
{ sourceName }
</div>
</div>
</div>
}
// Creates a card container.
// Accepts children
templ Card() {
<div class="card">
{ children... }
</div>
}
// Creates a image card container.
// Accepts children
templ CardImage() {
<div class="card-image">
{ children... }
</div>
}
//
templ CardImageSize(size string) {
<figure class={ "image", size }>
{ children... }
</figure>
}
templ CardContentContainer() {
<div class="card-content">
{ children... }
</div>
}

View File

@ -1 +0,0 @@
package example

View File

@ -0,0 +1,9 @@
package html
templ Img(src string) {
<img src={ src } />
}
templ ImgAlt(src, alt string) {
<img src={ src } alt={ alt }/>
}

View File

@ -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) {
<figure class={ "image", image }>
{ children... }
</figure>
}

View File

@ -1,4 +1,4 @@
package bulma
package layout
// Creates a <section> object thats good to break up a page of content.
templ Section(title, subtitle string) {