newsbot-portal/components/bulma/card.templ

53 lines
926 B
Plaintext
Raw Normal View History

package bulma
templ ArticleCardWithThumbnail(title, thumbnailUrl, url, datePosted, sourceName string) {
<div class="card">
<div class="card-image">
<figure class="is-4by3">
<img src={ thumbnailUrl }/>
</figure>
</div>
<div class="card-content">
<div class="media">
<div class="media-content">
<a href={ templ.SafeURL(url) }>{ title }</a>
</div>
</div>
<div class="content">
2024-07-14 09:07:53 -07:00
{ datePosted }
<br/>
{ sourceName }
</div>
</div>
</div>
}
2024-07-14 09:07:53 -07:00
// 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>
}