initial commit - added base, need to fix templ errors

This commit is contained in:
2025-08-17 10:58:31 +00:00
commit 59d82ae563
20 changed files with 1512 additions and 0 deletions

29
templates/post.templ Normal file
View File

@@ -0,0 +1,29 @@
package templates
templ PostDetail(post models.Post) {
<article class="post-detail">
<h1 class="post-title">{ post.Title }</h1>
<div class="post-meta">
Published: { post.PublishedAt.Format("January 2, 2006") } |
Tags:
for i, tag := range post.Tags {
if i > 0 {
,
}
<a href={ templ.URL("/tags/" + tag) }>{ tag }</a>
}
| { fmt.Sprintf("%d", post.WordCount) } words
</div>
<div class="post-content">
{ templ.Raw(post.Content) }
</div>
<div class="post-footer">
<a href="/"
hx-get="/"
hx-target="main"
hx-push-url="true">
<- Back to Posts
</a>
</div>
</article>
}