diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2019-10-06 21:10:46 +0200 |
---|---|---|
committer | Dimitri Staessens <dimitri@ouroboros.rocks> | 2019-10-06 21:10:46 +0200 |
commit | 568553394d0a8b34668a75c9839a0f1f426469b2 (patch) | |
tree | 175c08844f05611b059ba6900fb6519dbbc735d2 /themes/docsy/layouts/partials/navbar.html | |
parent | d5d6f70371958eec0679831abd283498ff2731e5 (diff) | |
download | website-568553394d0a8b34668a75c9839a0f1f426469b2.tar.gz website-568553394d0a8b34668a75c9839a0f1f426469b2.zip |
theme: Switch to docsy theme
Diffstat (limited to 'themes/docsy/layouts/partials/navbar.html')
-rw-r--r-- | themes/docsy/layouts/partials/navbar.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/themes/docsy/layouts/partials/navbar.html b/themes/docsy/layouts/partials/navbar.html new file mode 100644 index 0000000..284283b --- /dev/null +++ b/themes/docsy/layouts/partials/navbar.html @@ -0,0 +1,33 @@ +{{ $cover := .HasShortcode "blocks/cover" }} +<nav class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover}} td-navbar-cover {{ end }}flex-column flex-md-row td-navbar"> + <a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}"> + <span class="navbar-logo">{{ if .Site.Params.ui.navbar_logo }}{{ with resources.Get "icons/logo.svg" }}{{ ( . | minify).Content | safeHTML }}{{ end }}{{ end }}</span><span class="text-uppercase font-weight-bold">{{ .Site.Title }}</span> + </a> + <div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar"> + <ul class="navbar-nav mt-2 mt-lg-0"> + {{ $p := . }} + {{ range .Site.Menus.main }} + <li class="nav-item mr-4 mb-2 mb-lg-0"> + {{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) }} + {{ with .Page }} + {{ $active = or $active ( $.IsDescendant .) }} + {{ end }} + {{ $url := urls.Parse .URL }} + {{ $baseurl := urls.Parse $.Site.Params.Baseurl }} + <a class="nav-link{{if $active }} active{{end}}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}><span{{if $active }} class="active"{{end}}>{{ .Name }}</span></a> + </li> + {{ end }} + {{ if .Site.Params.versions }} + <li class="nav-item dropdown d-none d-lg-block"> + {{ partial "navbar-version-selector.html" . }} + </li> + {{ end }} + {{ if (gt (len .Site.Home.Translations) 0) }} + <li class="nav-item dropdown d-none d-lg-block"> + {{ partial "navbar-lang-selector.html" . }} + </li> + {{ end }} + </ul> + </div> + <div class="navbar-nav d-none d-lg-block">{{ partial "search-input.html" . }}</div> +</nav> |