diff options
author | IKEDA Kiyoshi <yasutake.kiyoshi@gmail.com> | 2017-01-12 00:36:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-12 00:36:03 +0300 |
commit | 5eb175413266df16a3602878cb48c6d987e46525 (patch) | |
tree | 53ec1cf287c2c10c89b3a6b7bfaa83c5d964feb2 | |
parent | ae1f1c2075514c2a97f235c7464e25588f9381db (diff) | |
parent | c0045dec7b801c8950e7cdbc6e653b3585976e3d (diff) |
Merge pull request #21 from key-amb/maint
Fix #20 / Use .IsHome and change way to detect active menu link
-rw-r--r-- | layouts/partials/header.html | 7 | ||||
-rw-r--r-- | theme.toml | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index f101804..bd8b3f8 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,13 +1,12 @@ <!DOCTYPE html> {{ $baseUrl := .Site.BaseURL }} -{{ $isHomePage := eq .Title .Site.Title }} <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="alternate" href="/index.xml" type="application/rss+xml" title="{{ .Site.Title }}"> <link rel="icon" href="{{ $baseUrl }}/favicon.ico"> - <title>{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }}</title> + <title>{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }}</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/{{ with .Site.Params.highlightStyle }}{{ . }}{{ else }}default{{ end }}.css"> <link rel="stylesheet" href="{{ $baseUrl }}/css/bootstrap.min.css"> @@ -32,11 +31,11 @@ </div> <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> + <li {{ if .IsHome }}class="active"{{ end }}><a href="{{ $baseUrl }}/">Home</a></li> {{ $url := .Permalink }} {{ with .Site.Params.mainMenu }} {{ range $menu := . }} - {{ $itemUrl := printf "%s/%s/" $baseUrl $menu.link }} + {{ $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 }} @@ -5,7 +5,7 @@ description = "A simple Hugo theme with Bootstrap for documentation" homepage = "http://key-amb.github.io/bootie-docs-demo/" tags = ["document", "bootstrap"] features = ["document", ""] -min_version = 0.14 +min_version = 0.15 [author] name = "IKEDA Kiyoshi" |