Unverified Commit 756090a0 authored by Ethan Madison's avatar Ethan Madison
Browse files

Replace $isHomePage with IsHome variable



A recent version of Hugo implemented the '.IsHome' page variable, which
replaces the now broken $isHomePage. (Hugo v1.8 broke title comparison
to determine if the current page is the home page since the home page's
title is "_index").

This commit replaces the broken $isHomePage with the functional .IsHome
and cleans up the logic used around using .IsHome.
Signed-off-by: default avatarEthan Madison <ethan@ethanmad.com>
parent 21a0d232
<!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>
{{ with .Site.Params.themeColor }}
<meta name="theme-color" content="{{ . }}" />
{{ end }}
......@@ -36,7 +35,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>
{{ if .Site.Params.mainMenu }}
{{ $url := .Permalink }}
{{ range $menu := .Site.Params.mainMenu }}
......
{{ $isHomePage := eq .Title .Site.Title }}
{{ $baseUrl := .Site.BaseURL }}
<div class="jumbotron" style="background-image: url({{ with .Params.image }}{{ . }}{{ else }}{{ with .Site.Params.image }}{{ $baseUrl }}/{{ . }}{{ end }}{{ end }});">
<div class="container">
<h1>{{ if $isHomePage }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}</h1>
<p>{{ if $isHomePage }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ else }}{{ with .Params.description }}{{ . }}{{ end }}{{ end }}</p>
<h1>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}</h1>
<p>{{ if .IsHome }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ else }}{{ with .Params.description }}{{ . }}{{ end }}{{ end }}</p>
</div>
</div>
{{ $isHomePage := eq .Title .Site.Title }}
{{ $baseUrl := .Site.BaseURL }}
{{ if .Site.Params.sponsor }}
......
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