diff options
author | key-amb <yasutake.kiyoshi@gmail.com> | 2017-01-12 00:18:05 +0300 |
---|---|---|
committer | key-amb <yasutake.kiyoshi@gmail.com> | 2017-01-12 00:18:05 +0300 |
commit | 2de5030e6c695064bb5d0d35c1f942da65a3d580 (patch) | |
tree | 6cc92f145c778840ffdba1c1149222726250cfda | |
parent | cdc869c0d4de39bdb684a8230052970ee56f780b (diff) |
Change / Use .IsHome to detect if current page is site home or not
-rw-r--r-- | layouts/partials/header.html | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 10a2f18..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,7 +31,7 @@ </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 := . }} |