bobatheme/layouts/partials/top.html

25 lines
1017 B
HTML
Raw Normal View History

2023-10-15 01:22:04 -05:00
<div class="top">
<header class="header">
<a class="heading-link" href="{{ .Site.Home.Permalink | absLangURL }}">
{{ .Site.Title | markdownify }}
</a>
</header>
2023-10-15 01:22:04 -05:00
<nav class="navbar" aria-label="{{ i18n "aria_navbar" }}">
{{ with .Site.Home }}
<a class="navbar-item{{ if $.IsHome }} active{{ end }}" href="{{ .Permalink | absLangURL }}">{{ .Title | markdownify }}</a>
{{ end }}
2023-10-15 01:22:04 -05:00
{{ range .Site.Menus.main }}
{{ $isActive := false }}
{{/* https://discourse.gohugo.io/t/ismenucurrent-not-working-with-using-sectionpagesmenu/46687/2?u=bbaovanc */}}
{{ if or ($.HasMenuCurrent .Menu .) (eq .Page $) }}
{{ $isActive = true }}
{{ end }}
<a class="navbar-item{{ if $isActive }} active{{ end }}"
{{ if strings.HasPrefix .URL "http" }}target="_blank" rel="noopener"{{ end }}
href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
2023-10-15 01:22:04 -05:00
</nav>
</div>