mirror of
				https://github.com/BBaoVanC/bobatheme.git
				synced 2025-10-30 17:53:28 -05:00 
			
		
		
		
	Any element that can't stand on its own as a self-contained component should have its naming nested under whatever parent it's supposed to have. Fixes #109
		
			
				
	
	
		
			25 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <header class="top">
 | |
|     <div class="top-brand">
 | |
|         <a href="{{ .Site.Home.Permalink | absLangURL }}">
 | |
|             {{ .Site.Title | markdownify }}
 | |
|         </a>
 | |
|     </div>
 | |
| 
 | |
|     <nav class="top-navbar" aria-label="{{ i18n "aria_navbar" }}">
 | |
|         {{ with .Site.Home }}
 | |
|             <a class="top-navbar-item{{ if $.IsHome }} top-navbar-item--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="top-navbar-item{{ if $isActive }} top-navbar-item--active{{ end }}"
 | |
|                {{ if strings.HasPrefix .URL "http" }}target="_blank" rel="noopener"{{ end }}
 | |
|                href="{{ .URL }}">{{ .Name }}</a>
 | |
|         {{ end }}
 | |
|     </nav>
 | |
| </header>
 |