1
0
dwelling-home/web/article.templ

28 lines
772 B
Plaintext
Raw Permalink Normal View History

package web
import "time"
import "net/http"
import "git.arav.su/Arav/dwelling-home/pkg/util"
import "github.com/invopop/ctxi18n/i18n"
templ Article(title, description, body, urlName string, date time.Time, r *http.Request) {
@base(title + " - " + i18n.T(ctx, "base.section.stuff"), description, "", "/stuff/article/"+urlName, r, articleHead()) {
<article>
<header>
<h2>{ title }</h2>
<div class="menu">
<a href="/stuff#articles">{ i18n.T(ctx, "article.go-back") }</a>
{{ dctz := util.ToClientTimezone(date, r) }}
2024-09-17 03:15:26 +04:00
<time datetime={ dctz.Format("2006-01-02") }>{ dctz.Format("02.01.2006") }</time>
</div>
</header>
@templ.Raw(body)
</article>
}
}
templ articleHead() {
<link rel="stylesheet" href="/assets/css/articles.css"/>
}