Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matsuyoshi30/harbor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNYPD <6412879+NYPD@users.noreply.github.com>2022-03-01 04:00:30 +0300
committerNYPD <6412879+NYPD@users.noreply.github.com>2022-03-01 04:00:30 +0300
commit267c2e2a00d9b8d658783e9fe9185664ce0b3551 (patch)
tree56c60ede08cef59c0831a5e2b02360d633aeda3e
parentec2a226f596fa5b6f12c878baecfbb265e2b4c18 (diff)
add meta description based on post or congif.toml
-rw-r--r--layouts/partials/head.html5
1 files changed, 2 insertions, 3 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index e746975..4e156c8 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -1,8 +1,7 @@
<meta charset="utf-8" />
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}</title>
-{{ with .Site.Params.description }}
- <meta name="description" content="{{ . }}" />
-{{ end }}
+<meta name="description"
+ content="{{ if .Params.Description }}{{ trim .Params.Description "\n" }}{{else if .Site.Params.Description}}{{ trim .Site.Params.Description "\n" }}{{ end }}">
{{- with .Site.Author.Name }}
<meta name="author" content="{{ . }}" />
{{- end }}