Make a category filter a <menu> within a section of posts on a mindflow page.
This commit is contained in:
parent
9cae292661
commit
6f06ee8977
@ -10,15 +10,13 @@ import "git.arav.su/Arav/dwelling-home/pkg/util"
|
||||
templ Mindflow(posts []mindflow.Post, categories []mindflow.Category, r *http.Request) {
|
||||
@base("Mindflow", "Updates on my infrastructure, my very important opinions and thoughts.", "updates, thoughts, opinions, blog, diary", "/mindflow", mindflowHead()) {
|
||||
<p class="center">Here I post updates on websites and infrastructure, my very important opinions and thoughts no one asked for. If you'd like to subscribe to this bullshittery then <a href="/rss.xml">RSS feed</a> at your service. :)</p>
|
||||
<section id="filter" class="hidden">
|
||||
<p class="center">
|
||||
<section>
|
||||
<menu id="filter" class="hidden">
|
||||
<button name="all">All</button>
|
||||
for _, category := range categories {
|
||||
<button name={ strings.ToLower(category.Name) }>{ category.Name }</button>
|
||||
}
|
||||
</p>
|
||||
</section>
|
||||
<section>
|
||||
</menu>
|
||||
for _, post := range posts {
|
||||
<article id={ post.PostID() }>
|
||||
<header>
|
||||
@ -38,7 +36,7 @@ templ Mindflow(posts []mindflow.Post, categories []mindflow.Category, r *http.Re
|
||||
} else {
|
||||
<span></span>
|
||||
}
|
||||
<time datetime={ util.ToClientTimezone(post.Date, r).Format(time.RFC1123) }>{ util.ToClientTimezone(post.Date, r).Format(time.RFC1123) }</time>
|
||||
<time datetime={ util.ToClientTimezone(post.Date, r).Format(time.RFC3339) }>{ util.ToClientTimezone(post.Date, r).Format(time.RFC1123) }</time>
|
||||
</footer>
|
||||
</article>
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user