refactor: unify title and description handling in meta files (#329)
This commit is contained in:
parent
d94859e4ae
commit
d2668b43f6
24 changed files with 240 additions and 105 deletions
|
@ -1,13 +1,14 @@
|
|||
<meta charset="UTF-8" />
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
{{ hugo.Generator }}
|
||||
|
||||
{{ $description := default (default .Site.Title .Site.Params.description) (default .Summary .Description) }}
|
||||
{{ $keywords := default .Site.Params.Keywords .Keywords }}
|
||||
|
||||
{{ with $description }}
|
||||
<meta name="description" content="{{ . }}" />
|
||||
{{ end }}
|
||||
{{ with $keywords }}
|
||||
{{- with partial "utils/description" . }}
|
||||
<meta name="description" content="{{ trim (. | plainify) "\n" }}" />
|
||||
{{- end }}
|
||||
{{- with $keywords }}
|
||||
<meta name="keywords" content="{{ delimit . "," }}" />
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue