mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +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 }}
|
{{- $langsrc := cond (eq $context.Lang $langtrg) (.langsrc | default "en") $context.Lang }}
|
||||||
{{- $baseURL := urls.Parse site.BaseURL }}
|
{{- $baseURL := urls.Parse site.BaseURL }}
|
||||||
{{- $baseURLpath := $baseURL.Path | default "/" }}
|
{{- $baseURLpath := $baseURL.Path | default "/" }}
|
||||||
{{- $l := "" }}
|
{{- $l := $context.RelPermalink }}
|
||||||
{{- $c := "" }}
|
{{- $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 }}
|
{{- range $context.AllTranslations }}
|
||||||
{{- if eq .Language.Lang $langsrc }}
|
{{- if eq .Language.Lang $langsrc }}
|
||||||
{{- $l = .RelPermalink }}
|
{{- $l = .RelPermalink }}
|
||||||
|
|
|
@ -5,12 +5,14 @@
|
||||||
<head>
|
<head>
|
||||||
{{- partial "meta.html" . }}
|
{{- partial "meta.html" . }}
|
||||||
{{- .Scratch.Add "title" "" }}
|
{{- .Scratch.Add "title" "" }}
|
||||||
|
{{- $title := .Title }}
|
||||||
{{- if eq .Site.Data.titles .Title }}
|
{{- if eq .Site.Data.titles .Title }}
|
||||||
{{- .Scratch.Set "title" (index .Site.Data.titles .Title).title }}
|
{{- $title = (index .Site.Data.titles .Title).title }}
|
||||||
{{- else }}
|
|
||||||
{{- .Scratch.Set "title" .Title}}
|
|
||||||
{{- end }}
|
{{- 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 }}">
|
<base href="{{ .Site.BaseURL }}">
|
||||||
{{- partialCached "favicon.html" . }}
|
{{- partialCached "favicon.html" . }}
|
||||||
{{- partialCached "stylesheet.html" (dict "page" . "outputFormat" $outputFormat) $outputFormat }}
|
{{- partialCached "stylesheet.html" (dict "page" . "outputFormat" $outputFormat) $outputFormat }}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
{{- else if eq .Kind "term" }}
|
{{- else if eq .Kind "term" }}
|
||||||
{{- $title = printf "%s %s" (.Data.Singular | humanize) $title }}
|
{{- $title = printf "%s %s" (.Data.Singular | humanize) $title }}
|
||||||
{{- end }}
|
{{- 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 }}
|
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<title>{{ $title }}</title>
|
<title>{{ $title }}</title>
|
||||||
|
|
Loading…
Reference in a new issue