Work on image rendering

This commit is contained in:
Dominic Ferrando
2025-04-18 14:38:46 -04:00
parent ac9c516550
commit 4265b8583b
9 changed files with 53 additions and 22 deletions
+4
View File
@@ -1,15 +1,19 @@
package views
import "fmt"
type CatalogThreadPreview struct {
Subject string
Body string
ThreadURL string
MediaPath string
}
templ ThreadsCatalog(previews []CatalogThreadPreview) {
<div id="catalog">
for _, preview := range previews {
<div class="catalog-preview">
<img class="catalog-preview-img" src={ fmt.Sprintf("/static/img/posts/%s", preview.MediaPath) } />
<h1><a href={ templ.SafeURL(preview.ThreadURL) } class="catalog-preview-link">{ preview.Subject }</a></h1>
<p>{ preview.Body }</p>
</div>