Updated @navigation().
This commit is contained in:
parent
526636bdd7
commit
6f15fb4f2b
@ -49,19 +49,20 @@ templ base(title, description, keywords, canonical string, head templ.Component)
|
||||
|
||||
templ navigation(title string) {
|
||||
{{ sections := []string{"Stuff", "Mindflow", "About", "Guestbook"} }}
|
||||
{{ links := []templ.SafeURL{"/stuff", "/mindflow", "/about", "/guestbook"} }}
|
||||
<nav>
|
||||
<div>
|
||||
if title != "Home" {
|
||||
if title != "" {
|
||||
<a href="/">Home</a>
|
||||
}
|
||||
for _, s := range sections {
|
||||
for i, s := range sections {
|
||||
if strings.HasSuffix(title, s) {
|
||||
{{ continue }}
|
||||
}
|
||||
<a href={ templ.URL("/"+strings.ToLower(s)) }>{ s }</a>
|
||||
<a href={ links[i] }>{ s }</a>
|
||||
}
|
||||
</div>
|
||||
if title != "" && title != "Home" {
|
||||
if title != "" {
|
||||
<h1>
|
||||
if strings.HasSuffix(title, "- Stuff") {
|
||||
Stuff
|
||||
|
Loading…
Reference in New Issue
Block a user