1
0

Wrap nav links into a list.

This commit is contained in:
Alexander Andreev 2024-06-30 00:12:18 +04:00
parent c0e4981d62
commit e313a52daf
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34
2 changed files with 6 additions and 5 deletions

View File

@ -147,9 +147,10 @@ header.main nav {
font-variant: small-caps; font-variant: small-caps;
width: 300px; } width: 300px; }
header.main nav div { header.main nav ul {
display: flex; display: flex;
justify-content: space-evenly; justify-content: space-evenly;
list-style: none;
width: 100%; } width: 100%; }
section { section {

View File

@ -51,17 +51,17 @@ templ navigation(title string) {
{{ sections := []string{"Stuff", "Mindflow", "About", "Guestbook"} }} {{ sections := []string{"Stuff", "Mindflow", "About", "Guestbook"} }}
{{ links := []templ.SafeURL{"/stuff", "/mindflow", "/about", "/guestbook"} }} {{ links := []templ.SafeURL{"/stuff", "/mindflow", "/about", "/guestbook"} }}
<nav> <nav>
<div> <ul>
if title != "" { if title != "" {
<a href="/">Home</a> <li><a href="/">Home</a></li>
} }
for i, s := range sections { for i, s := range sections {
if strings.HasSuffix(title, s) { if strings.HasSuffix(title, s) {
{{ continue }} {{ continue }}
} }
<a href={ links[i] }>{ s }</a> <li><a href={ links[i] }>{ s }</a></li>
} }
</div> </ul>
if title != "" { if title != "" {
<h1> <h1>
if strings.HasSuffix(title, "- Stuff") { if strings.HasSuffix(title, "- Stuff") {