mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-12 17:57:28 -05:00
Redesign navbar to be full width
This commit is contained in:
@ -8,38 +8,42 @@
|
||||
|
||||
{{ partial "top.html" . }}
|
||||
|
||||
{{ if not .IsHome }}
|
||||
{{ partial "breadcrumb.html" . }}
|
||||
{{ end }}
|
||||
<div class="center-body">
|
||||
|
||||
<main>
|
||||
{{ block "main" . }}
|
||||
THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it)
|
||||
{{ if not .IsHome }}
|
||||
{{ partial "breadcrumb.html" . }}
|
||||
{{ end }}
|
||||
</main>
|
||||
|
||||
{{ if or .Site.Copyright .Site.Params.footer }}
|
||||
<footer>
|
||||
{{ with .Site.Copyright }}
|
||||
<p>{{ . | safeHTML }}</p>
|
||||
<main>
|
||||
{{ block "main" . }}
|
||||
THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it)
|
||||
{{ end }}
|
||||
</main>
|
||||
|
||||
{{ with .Site.Params.footer }}
|
||||
{{ . | $.RenderString (dict "display" "block") }}
|
||||
{{ end }}
|
||||
</footer>
|
||||
{{ end }}
|
||||
{{ if or .Site.Copyright .Site.Params.footer }}
|
||||
<footer>
|
||||
{{ with .Site.Copyright }}
|
||||
<p>{{ . | safeHTML }}</p>
|
||||
{{ end }}
|
||||
|
||||
<a id="back-to-top" href="#top" aria-label="{{ i18n "aria_back_to_top_button" }}">
|
||||
{{ partial "icon.html" "chevron-up" }}
|
||||
</a>
|
||||
<noscript>
|
||||
<style>
|
||||
#back-to-top {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</noscript>
|
||||
{{ with .Site.Params.footer }}
|
||||
{{ . | $.RenderString (dict "display" "block") }}
|
||||
{{ end }}
|
||||
</footer>
|
||||
{{ end }}
|
||||
|
||||
<a id="back-to-top" href="#top" aria-label="{{ i18n "aria_back_to_top_button" }}">
|
||||
{{ partial "icon.html" "chevron-up" }}
|
||||
</a>
|
||||
<noscript>
|
||||
<style>
|
||||
#back-to-top {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</noscript>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -1,22 +1,24 @@
|
||||
<header class="header">
|
||||
<a class="heading-link" href="{{ .Site.Home.Permalink | absLangURL }}">
|
||||
{{ .Site.Title | markdownify }}
|
||||
</a>
|
||||
</header>
|
||||
<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 }}
|
||||
<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 }}
|
||||
<a class="navbar-item{{ if $isActive }} active{{ end }}"
|
||||
{{ if strings.HasPrefix .URL "http" }}target="_blank" rel="noopener"{{ end }}
|
||||
href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
|
||||
{{ 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