diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2021-03-27 11:51:48 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2021-03-27 12:46:43 +0530 |
| commit | 009d3a2e1d74603e58c6983df33798ea6d01abd5 (patch) | |
| tree | 0bfaa1d3e448684c09e57cdb114530e7574e34cc /layouts | |
| parent | e503367a1adff7a62f4d7773f06f071f910ffc5a (diff) | |
Fix logo not being displayed with no title pages
- use a local var to get label text ot site title
fixes: #281
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/partials/header.html | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 23f2588..8fa2dbe 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -80,13 +80,14 @@ <header class="header"> <nav class="nav"> <div class="logo"> - {{- if .Title }} - <a href="{{ "" | absLangURL }}" accesskey="h" title="{{ .Site.Params.label.text | default .Site.Title }} (Alt + H)"> + {{- $label_text := (.Site.Params.label.text | default .Site.Title) }} + {{- if .Site.Title }} + <a href="{{ "" | absLangURL }}" accesskey="h" title="{{ $label_text }} (Alt + H)"> {{- if .Site.Params.label.icon }} <img src="{{- .Site.Params.label.icon -}}" alt="logo" aria-label="logo" height="{{- .Site.Params.label.iconHeight | default "30px" -}}"> {{- end -}} - {{- .Site.Params.label.text | default .Site.Title -}} + {{- $label_text -}} </a> {{- end }} <span class="logo-switches"> @@ -113,7 +114,7 @@ </button> {{- end}} {{ $lang := .Lang}} - {{ $separator := or .Title (not .Site.Params.disableThemeToggle)}} + {{ $separator := or $label_text (not .Site.Params.disableThemeToggle)}} {{- with $.Site.Home.AllTranslations }} <ul class="lang-switch"> |
