mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
theme: make sure to display well with no theme specific params set #516
This commit is contained in:
parent
77f41e9607
commit
c975dfd2de
3 changed files with 15 additions and 6 deletions
|
@ -6,8 +6,15 @@
|
|||
{{- $langsrc := cond (eq $context.Lang $langtrg) (.langsrc | default "en") $context.Lang }}
|
||||
{{- $baseURL := urls.Parse site.BaseURL }}
|
||||
{{- $baseURLpath := $baseURL.Path | default "/" }}
|
||||
{{- $l := "" }}
|
||||
{{- $l := $context.RelPermalink }}
|
||||
{{- $c := "" }}
|
||||
{{- if ne $content nil }}
|
||||
{{- $c = $content }}
|
||||
{{- else if eq $pagefield "Content" }}
|
||||
{{- $c = $context.Content }}
|
||||
{{- else if eq $pagefield "TableOfContents" }}
|
||||
{{- $c = $context.TableOfContents }}
|
||||
{{- end }}
|
||||
{{- range $context.AllTranslations }}
|
||||
{{- if eq .Language.Lang $langsrc }}
|
||||
{{- $l = .RelPermalink }}
|
||||
|
|
|
@ -5,12 +5,14 @@
|
|||
<head>
|
||||
{{- partial "meta.html" . }}
|
||||
{{- .Scratch.Add "title" "" }}
|
||||
{{- $title := .Title }}
|
||||
{{- if eq .Site.Data.titles .Title }}
|
||||
{{- .Scratch.Set "title" (index .Site.Data.titles .Title).title }}
|
||||
{{- else }}
|
||||
{{- .Scratch.Set "title" .Title}}
|
||||
{{- $title = (index .Site.Data.titles .Title).title }}
|
||||
{{- end }}
|
||||
<title>{{ .Scratch.Get "title" }} {{ default "::" .Site.Params.titleSeparator }} {{ .Site.Title }}</title>
|
||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||
{{- end }}
|
||||
<title>{{ $title }}</title>
|
||||
<base href="{{ .Site.BaseURL }}">
|
||||
{{- partialCached "favicon.html" . }}
|
||||
{{- partialCached "stylesheet.html" (dict "page" . "outputFormat" $outputFormat) $outputFormat }}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
{{- else if eq .Kind "term" }}
|
||||
{{- $title = printf "%s %s" (.Data.Singular | humanize) $title }}
|
||||
{{- end }}
|
||||
{{- if and $title (not (eq $title .Site.Title)) }}
|
||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||
{{- end }}
|
||||
<title>{{ $title }}</title>
|
||||
|
|
Loading…
Reference in a new issue