27 lines
707 B
Plaintext
27 lines
707 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 + " - Articles", description, "", "/stuff/article/"+urlName, "Articles", 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"/>
|
|
}
|