summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authora73x <[email protected]>2024-09-03 08:16:46 +0100
committera73x <[email protected]>2024-09-03 08:16:46 +0100
commit1c0e1cc8c6a51457907ce028599c2bcad82d0bfd (patch)
tree1c1e8436cef1fbb4724b88731afe2ddd5d40ad74
parent94392c082192b1fc69fda2954e7b60eb0b741a72 (diff)
feat(html): nav underlines if page selected
-rw-r--r--content/index.md3
-rw-r--r--templates/layouts/_default.html15
2 files changed, 15 insertions, 3 deletions
diff --git a/content/index.md b/content/index.md
index 3c6686b..240517a 100644
--- a/content/index.md
+++ b/content/index.md
@@ -1,6 +1,7 @@
---
-title: me
+title: home
---
+## me
* backend cloud software engineer
* lang: go
* infra: kubernetes
diff --git a/templates/layouts/_default.html b/templates/layouts/_default.html
index 0762919..09b2239 100644
--- a/templates/layouts/_default.html
+++ b/templates/layouts/_default.html
@@ -18,6 +18,10 @@
font-style: normal;
}
+ .no-decorations {
+ text-decoration: none;
+ }
+
code:not(pre > code) {
background-color: #f0f0f0;
padding: 0.2em 0.4em;
@@ -52,16 +56,23 @@
}
</style>
</head>
-
<body>
- <h2>a73x</h2>
+ <h1>a73x</h1>
<sub>high effort, low reward</sub>
<nav>
<ul>
+ {{ if eq .Path "index" }}
<li><a href="/">home</a></li>
+ {{else}}
+ <li><a class="no-decorations" href="/">home</a></li>
+ {{end}}
{{ range $key, $value := .Collections }}
{{if ne $key "all"}}
+ {{ if eq $.Path $key }}
<li><a href="/{{$key}}">{{$key}}</a></li>
+ {{else}}
+ <li><a class="no-decorations" href="/{{$key}}">{{$key}}</a></li>
+ {{end}}
{{end}}
{{end}}
</ul>