1
0

Decided to hide a current section in menu.

This commit is contained in:
Alexander Andreev 2024-06-21 00:30:02 +04:00
parent 5db465d72a
commit b1d7f92cff
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -46,15 +46,18 @@ templ base(title, description, keywords, canonical string, head templ.Component)
}
templ navigation(heading string) {
{{ links := []string{"Stuff", "Mindflow", "About", "Guestbook"} }}
<nav>
<div>
if heading != "Home" {
<a href="/">Home</a>
}
<a href="/stuff">Stuff</a>
<a href="/mindflow">Mindflow</a>
<a href="/about">About</a>
<a href="/guestbook">Guestbook</a>
for _, n := range links {
if n == heading {
{{ continue }}
}
<a href={ templ.URL("/"+strings.ToLower(n)) }>{ n }</a>
}
</div>
if heading != "" && heading != "Home" {
if strings.HasSuffix(heading, "Article") {