Commit 2de5030e authored by key-amb's avatar key-amb
Browse files

Change / Use .IsHome to detect if current page is site home or not

parent cdc869c0
<!DOCTYPE html> <!DOCTYPE html>
{{ $baseUrl := .Site.BaseURL }} {{ $baseUrl := .Site.BaseURL }}
{{ $isHomePage := eq .Title .Site.Title }}
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <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="alternate" href="/index.xml" type="application/rss+xml" title="{{ .Site.Title }}">
<link rel="icon" href="{{ $baseUrl }}/favicon.ico"> <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 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/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.min.css">
...@@ -32,7 +31,7 @@ ...@@ -32,7 +31,7 @@
</div> </div>
<div id="navbar" class="navbar-collapse collapse"> <div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"> <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 }} {{ $url := .Permalink }}
{{ with .Site.Params.mainMenu }} {{ with .Site.Params.mainMenu }}
{{ range $menu := . }} {{ range $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