mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
⚡ Perf: optimize keywords meta generation code
This commit is contained in:
@@ -3,7 +3,18 @@
|
||||
<meta name="author" content="{{ .Site.Author.name }}">
|
||||
<meta name="author-link" content="{{ .Site.Author.link }}">
|
||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage | and .Summary }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
|
||||
<meta name="keywords" content="{{ $keywords := .Keywords }}{{ if not $keywords }}{{ if .IsPage | and .Params.tags }}{{ $keywords = .Params.tags }}{{ else }}{{ $keywords = .Site.Params.keywords }}{{ end }}{{ end }}{{ range $index, $keyword := $keywords }}{{ if ne $index 0 }},{{ end }}{{ $keyword }}{{ end }}" />
|
||||
|
||||
{{- $keywords := .Keywords -}}
|
||||
{{- if not $keywords -}}
|
||||
{{- if .IsPage | and .Params.tags -}}
|
||||
{{- $keywords = .Params.tags -}}
|
||||
{{- else -}}
|
||||
{{- $keywords = .Site.Params.keywords -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- with $keywords -}}
|
||||
<meta name="keywords" content='{{ delimit . ", " }}' />
|
||||
{{- end -}}
|
||||
|
||||
{{- template "_internal/schema.html" . -}}
|
||||
{{- template "_internal/opengraph.html" . -}}
|
||||
|
||||
Reference in New Issue
Block a user