blob: 26991a37dd96d09dc51cfe7366aea56aceed8828 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
{% code
type Selection int
const (
Git Selection = iota
List
About
Config
)
%}
{% func insertIfEqual(s, d Selection) %}{% if s == d %} selected{% endif %}{% endfunc %}
{% func Navbar (s Selection) %}
<nav class="container navbar navbar-expand-sm">
<div class="navbar-nav">
<a class="nav-link{%= insertIfEqual(s, Git) %}" href="/git">git</a>
<a class="nav-link{%= insertIfEqual(s, List) %}" href="/list">list</a>
<a class="nav-link{%= insertIfEqual(s, About) %}" href="/about">about</a>
<a class="nav-link{%= insertIfEqual(s, Config) %}" href="/config">config</a>
</div>
</nav>
{% endfunc %}
|