Commit 5eb17541 authored by IKEDA Kiyoshi's avatar IKEDA Kiyoshi Committed by GitHub
Browse files

Merge pull request #21 from key-amb/maint

Fix #20 / Use .IsHome and change way to detect active menu link
parents ae1f1c20 c0045dec
<!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,11 +31,11 @@ ...@@ -32,11 +31,11 @@
</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 := . }}
{{ $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> <li {{ if eq $url $itemUrl }}class="active"{{ end }}><a href="{{ $baseUrl }}/{{ $menu.link }}">{{ $menu.name }}</a></li>
{{ end }} {{ end }}
{{ end }} {{ end }}
......
...@@ -5,7 +5,7 @@ description = "A simple Hugo theme with Bootstrap for documentation" ...@@ -5,7 +5,7 @@ description = "A simple Hugo theme with Bootstrap for documentation"
homepage = "http://key-amb.github.io/bootie-docs-demo/" homepage = "http://key-amb.github.io/bootie-docs-demo/"
tags = ["document", "bootstrap"] tags = ["document", "bootstrap"]
features = ["document", ""] features = ["document", ""]
min_version = 0.14 min_version = 0.15
[author] [author]
name = "IKEDA Kiyoshi" name = "IKEDA Kiyoshi"
......
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