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

github.com/it-gro/hugo-theme-w3css-basic.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorit-gro <grossnik@tuvok>2018-06-28 14:46:53 +0300
committerit-gro <grossnik@tuvok>2018-06-28 14:46:53 +0300
commit7df3f667f79fc49fdb2c89e05e5c78c7da131eb7 (patch)
treea36b473bd9916fe88cc267e20c47641394986e5a /layouts
parentbe54d60e098940288be5324a681f91b809d6752a (diff)
Add config truncateSummaryForMetaDescription
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/head.meta.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/layouts/partials/head.meta.html b/layouts/partials/head.meta.html
index 97ea3d7..b56cc25 100644
--- a/layouts/partials/head.meta.html
+++ b/layouts/partials/head.meta.html
@@ -8,7 +8,7 @@
<meta name="googlebot" content="index,follow,snippet,archive" />
<meta name="author" content='{{ $.Site.Params.authorName }}' />
- {{- if or .Keywords .Params.tags .Params.categories -}}
+ {{- if or .Keywords .Params.tags .Params.categories }}
<meta name="keywords" content='{{ if .Keywords }} {{ chomp (delimit .Keywords `, ` ) }},{{ end -}}
{{ if .Params.tags }} {{ chomp (delimit .Params.tags `, ` ) }},{{ end -}}
{{ if .Params.categories }} {{ chomp (delimit .Params.categories `, ` ) }} {{ end -}}' />
@@ -18,6 +18,8 @@
{{- if .Description }}
<meta name="description" content='{{- chomp .Description -}}' />
+ {{- else if .Summary }}
+ <meta name="description" content='{{- chomp (.Summary | truncate (or $.Site.Params.truncateSummaryForMetaDescription 160) ) -}}' />
{{- else if $.Site.Params.DefaultDescription }}
<meta name="description" content='{{- chomp $.Site.Params.defaultDescription -}}' />
{{- end -}}