initial commit - added base, need to fix templ errors
This commit is contained in:
29
templates/post.templ
Normal file
29
templates/post.templ
Normal 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>
|
||||
}
|
Reference in New Issue
Block a user