Commit 67c71039 authored by key-amb's avatar key-amb
Browse files

Fix for Hugo v0.18 / .Site.Params "mainMenu" is not accessible now

See #18
parent 0a87855f
......@@ -7,7 +7,7 @@
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<h1>{{ .Site.Title }}</h1>
<p>{{ if isset .Site.Params "description" }}{{ .Site.Params.description }}{{ else }}You can customize this text by params "description" in your <code>config.toml</code>.{{ end }}</p>
<p>{{ if .Site.Params.description }}{{ .Site.Params.description }}{{ else }}You can customize this text by params "description" in your <code>config.toml</code>.{{ end }}</p>
</div>
</div>
......@@ -41,7 +41,7 @@
</div>
</div>
{{ if isset .Site.Params "withSitePosts" }}
{{ if .Site.Params.withSitePosts }}
<hr />
<div class="row doc-main text-center">
......@@ -51,4 +51,4 @@
</main>
{{ partial "footer.html" . }}
\ No newline at end of file
{{ partial "footer.html" . }}
......@@ -9,7 +9,7 @@
<link rel="icon" href="{{ $baseUrl }}/favicon.ico">
<title>{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }}</title>
<!--<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 isset .Site.Params "highlightStyle" }}{{ .Site.Params.highlightStyle }}{{ else }}default{{ end }}.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/bootstrap.min.css">
<link rel="stylesheet" href="{{ $baseUrl }}/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="{{ $baseUrl }}/css/theme.css">
......@@ -33,14 +33,14 @@
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li {{ if eq $isHomePage true }}class="active"{{ end }}><a href="{{ $baseUrl }}/">Home</a></li>
{{ if isset .Site.Params "mainMenu" }}
{{ if .Site.Params.mainMenu }}
{{ $url := .Permalink }}
{{ range $menu := .Site.Params.mainMenu }}
{{ $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 isset .Site.Params "noCategoryLink" }}{{ else }}
{{ if .Site.Params.noCategoryLink }}{{ else }}
<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