starting to build out how to view articles

This commit is contained in:
James Tombleson 2024-05-18 22:40:13 -07:00
parent 0183bd43e5
commit 8d83d6f545

View File

@ -1,15 +1,27 @@
package articles package articles
import ( import (
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout" "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
"git.jamestombleson.com/jtom38/newsbot-portal/internal/models" "git.jamestombleson.com/jtom38/newsbot-portal/internal/models"
) )
templ List(model models.ListArticlesViewModel) { templ List(model models.ListArticlesViewModel) {
@layout.WithTemplate() { @layout.WithTemplate() {
for _, item := range model.Items { for _, item := range model.Items {
{ item.Title } <div class="card">
} <div class="card-image">
<div>hi </div> <figure class="is-4by3">
} <img src={ item.Thumbnail }/>
</figure>
</div>
<div class="card-content">
<div class="media">
<div class="media-content">
<a href={ templ.SafeURL(item.Url) }>{ item.Title }</a>
</div>
</div>
</div>
</div>
}
}
} }