1
0

Make a category filter a <menu> within a section of posts on a mindflow page.

This commit is contained in:
Alexander Andreev 2024-06-27 03:02:52 +04:00
parent 9cae292661
commit 6f06ee8977
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -10,15 +10,13 @@ import "git.arav.su/Arav/dwelling-home/pkg/util"
templ Mindflow(posts []mindflow.Post, categories []mindflow.Category, r *http.Request) { 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()) { @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> <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"> <section>
<p class="center"> <menu id="filter" class="hidden">
<button name="all">All</button> <button name="all">All</button>
for _, category := range categories { for _, category := range categories {
<button name={ strings.ToLower(category.Name) }>{ category.Name }</button> <button name={ strings.ToLower(category.Name) }>{ category.Name }</button>
} }
</p> </menu>
</section>
<section>
for _, post := range posts { for _, post := range posts {
<article id={ post.PostID() }> <article id={ post.PostID() }>
<header> <header>
@ -38,7 +36,7 @@ templ Mindflow(posts []mindflow.Post, categories []mindflow.Category, r *http.Re
} else { } else {
<span></span> <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> </footer>
</article> </article>
} }