mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Den McHenry
16.26.2018 d5b87cb15e820e3ee8335363b26f4fcbf0e8d783
refs
author Den McHenry <denmch@users.noreply.github.com>
Tuesday, January 16, 2018 02:26 +0100
committer Bud Parr <budparr@gmail.com>
Tuesday, January 16, 2018 02:26 +0100
commitd5b87cb15e820e3ee8335363b26f4fcbf0e8d783
tree 0cd4c038f4c08cf1540fc33b8cc51916a5f1db23 tree | zip | gz
parent 8b59adb79bab46e069b8841414e9ed4e6b2eff38 view | diff
Don't duplicate site title in home page TITLE tag (#78)

Let's say your `.Site.Title` is "My Website". The code grabs `.Site.Title`, and then then checks to see if there's a `.Title`. When you're on the homepage, `.Title` is equivalent to `.Site.Title`, so that the browser bar will read:

> My Website | My Website

If we qualify `.Title` by confining to the `.Params` namespace, then the site title isn't duplicated:

```<title>{{ block "title" . }}{{ .Site.Title }} {{ with .Params.Title }} | {{ . }}{{ end }}{{ end }}</title>```

> My Website

But it still picks up `.Title` from posts and pages, where a content title exists in front matter:

> My Website | About Me
1 files modified
2 ■■■ changed files
layouts/_default/baseof.html 2 ●●● diff | view | raw | blame | history