Get basic thumbnails working

This commit is contained in:
Dominic Ferrando
2025-04-19 18:46:56 -04:00
parent b785ba0448
commit 9096c00db5
7 changed files with 54 additions and 27 deletions
+6 -1
View File
@@ -74,7 +74,12 @@ templ ThreadsCatalog(previews []CatalogThreadPreview) {
for _, preview := range previews {
<div class="catalog-preview">
<a href={ templ.URL(preview.ThreadURL) }>
<img class="catalog-preview-img" src={ fmt.Sprintf("/static/img/posts/full/%s", preview.MediaPath) }/>
<img
loading="lazy"
class="catalog-preview-img"
src={ fmt.Sprintf("/static/img/posts/thumb/%s",
preview.MediaPath) }
/>
</a>
<h1>
<a href={ templ.URL(preview.ThreadURL) } class="thread-subject catalog-preview-link">{ preview.Subject }</a>
+1 -1
View File
@@ -20,7 +20,7 @@ templ ThreadPost(post database.Post, thread *database.Thread) {
<article id={ fmt.Sprintf("post-%d", post.Id) } class={ getPostClass(isOp) }>
if post.MediaPath != "" {
<div class="post-img-container">
<img src={ fmt.Sprintf("/static/img/posts/full/%s", post.MediaPath) } class="post-img"/>
<img loading="lazy" src={ fmt.Sprintf("/static/img/posts/thumb/%s", post.MediaPath) } class="post-img"/>
</div>
}
<header class="post-header">