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) { templ navigation(heading string) {
{{ links := []string{"Stuff", "Mindflow", "About", "Guestbook"} }}
<nav> <nav>
<div> <div>
if heading != "Home" { if heading != "Home" {
<a href="/">Home</a> <a href="/">Home</a>
} }
<a href="/stuff">Stuff</a> for _, n := range links {
<a href="/mindflow">Mindflow</a> if n == heading {
<a href="/about">About</a> {{ continue }}
<a href="/guestbook">Guestbook</a> }
<a href={ templ.URL("/"+strings.ToLower(n)) }>{ n }</a>
}
</div> </div>
if heading != "" && heading != "Home" { if heading != "" && heading != "Home" {
if strings.HasSuffix(heading, "Article") { if strings.HasSuffix(heading, "Article") {