1
0
dwelling-home/web/article.templ

27 lines
692 B
Plaintext

package web
import "time"
import "net/http"
import "git.arav.su/Arav/dwelling-home/pkg/util"
templ Article(title, description, body, urlName string, date time.Time, r *http.Request) {
@base(title + " - Stuff", description, "", "/stuff/article/"+urlName, articleHead()) {
<article>
<header>
<h2>{ title }</h2>
<div class="menu">
<a href="/stuff#articles">Go back to articles list</a>
{{ dctz := util.ToClientTimezone(date, r) }}
<time datetime={ dctz.Format("2006-01-02") }>{ dctz.Format("02 January 2006") }</time>
</div>
</header>
@templ.Raw(body)
</article>
}
}
templ articleHead() {
<link rel="stylesheet" href="/assets/css/articles.css"/>
}