From 489b868ca0b84c2cdfd3948e683ab5906e598b94 Mon Sep 17 00:00:00 2001 From: Michael Romero Date: Thu, 12 Apr 2018 22:05:45 -0700 Subject: [PATCH] Allow defining a custom header text for the home page Allow defining a custom header text for the home page --- exampleSite/config.toml | 1 + layouts/partials/header.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 71d832d..f101641 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -14,6 +14,7 @@ pygmentsCodefencesGuessSyntax = true #googleAnalytics = "XXX" [Params] +# homeTitle = "Beautiful Hugo Theme" # Set a different text for the header on the home page subtitle = "Build a beautiful and simple website in minutes" logo = "img/avatar-icon.png" favicon = "img/favicon.ico" diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 4245e78..2a2fef6 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,5 +1,5 @@ {{ if .IsHome }} - {{ if isset .Params "title" }}{{ $.Scratch.Set "title" .Title }}{{ else }}{{ $.Scratch.Set "title" .Site.Title }}{{ end }} + {{ if .Site.Params.homeTitle }}{{ $.Scratch.Set "title" .Site.Params.homeTitle }}{{ else }}{{ $.Scratch.Set "title" .Site.Title }}{{ end }} {{ if .Site.Params.subtitle }}{{ $.Scratch.Set "subtitle" .Site.Params.subtitle }}{{ end }} {{ if .Site.Params.bigimg }}{{ $.Scratch.Set "bigimg" .Site.Params.bigimg }}{{ end }} {{ else }}