mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-29 00:27:30 -05:00
Move template files based on Hugo v0.146 revamp
See https://gohugo.io/templates/new-templatesystem-overview/ Under layouts/ - mv _default/* . - mv partials _partials - mv shortcodes _shortcodes - mv taxonomy/list.html taxonomy.html - mv taxonomy/term.html term.html
This commit is contained in:
24
layouts/_partials/top.html
Normal file
24
layouts/_partials/top.html
Normal file
@ -0,0 +1,24 @@
|
||||
<div class="top">
|
||||
<header class="header">
|
||||
<a class="heading-link" href="{{ .Site.Home.Permalink | absLangURL }}">
|
||||
{{ .Site.Title | markdownify }}
|
||||
</a>
|
||||
</header>
|
||||
|
||||
<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 }}
|
||||
|
||||
{{ 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 }}
|
||||
</nav>
|
||||
</div>
|
Reference in New Issue
Block a user