Make threads openable from catalog

This commit is contained in:
Dominic Ferrando
2025-04-18 11:21:47 -04:00
parent e53a65d437
commit a809b3c403
8 changed files with 134 additions and 68 deletions
+18
View File
@@ -0,0 +1,18 @@
package views
type CatalogThreadPreview struct {
Subject string
Body string
ThreadURL string
}
templ ThreadsCatalog(previews []CatalogThreadPreview) {
<div id="catalog">
for _, preview := range previews {
<div class="catalog-post">
<h1><a href={ templ.SafeURL(preview.ThreadURL) } class="catalog-post-link">{ preview.Subject }</a></h1>
<p>{ preview.Body }</p>
</div>
}
</div>
}