Unverified Commit 494fc5b9 authored by Ethan Madison's avatar Ethan Madison
Browse files

Improve logic in header partial

Use 'with' and 'not' to reduce redundancy.

Changes implemented upstream per my suggestion by
https://github.com/key-amb/hugo-theme-bootie-docs/commit/ead12f

.
Signed-off-by: default avatarEthan Madison <ethan@ethanmad.com>
parent 756090a0
......@@ -11,7 +11,7 @@
<meta name="theme-color" content="{{ . }}" />
{{ end }}
<!--<link href="http://fonts.googleapis.com/css?family=PT+Sans:400,700" rel="stylesheet" type="text/css">-->
<link rel="stylesheet" href="{{ $baseUrl }}/css/highlight/{{ if .Site.Params.highlightStyle }}{{ .Site.Params.highlightStyle }}{{ else }}default{{ end }}.css">
<link rel="stylesheet" href="{{ $baseUrl }}/css/highlight/{{ with .Site.Params.highlightStyle }}{{ . }}{{ else }}default{{ end }}.css">
<link rel="stylesheet" href="{{ $baseUrl }}/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ $baseUrl }}/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="{{ $baseUrl }}/css/theme.css">
......@@ -36,14 +36,14 @@
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li {{ if .IsHome}}class="active"{{ end }}><a href="{{ $baseUrl }}/">Home</a></li>
{{ if .Site.Params.mainMenu }}
{{ $url := .Permalink }}
{{ range $menu := .Site.Params.mainMenu }}
{{ $url := .Permalink }}
{{ with .Site.Params.mainMenu }}
{{ range $menu := . }}
{{ $itemUrl := printf "%s/%s/" $baseUrl $menu.link }}
<li {{ if eq $url $itemUrl }}class="active"{{ end }}><a href="{{ $baseUrl }}/{{ $menu.link }}">{{ $menu.name }}</a></li>
{{ end }}
{{ end }}
{{ if .Site.Params.noCategoryLink }}{{ else }}
{{ if not .Site.Params.noCategoryLink }}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Categories<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment