summaryrefslogtreecommitdiffstats
path: root/layouts/partials/description.html
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-05-16 00:33:53 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-05-16 00:33:53 +0200
commitcfc3f2c8c067d47505e64b1445c4692316fd4eb6 (patch)
tree0f88f5e4ffb31b9b7484865945c2612d7b684069 /layouts/partials/description.html
parent046753f526fb3247855886d229768076667fd1a1 (diff)
downloadgohugo-theme-ed-cfc3f2c8c067d47505e64b1445c4692316fd4eb6.tar.gz
Introduce description partial
Diffstat (limited to 'layouts/partials/description.html')
-rw-r--r--layouts/partials/description.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/layouts/partials/description.html b/layouts/partials/description.html
new file mode 100644
index 0000000..e63c0d9
--- /dev/null
+++ b/layouts/partials/description.html
@@ -0,0 +1,15 @@
+{{- $description := "" -}}
+
+{{- if .IsHome -}}
+ {{- $description = site.Params.Description -}}
+{{- else -}}
+ {{- if and (.Params.Description) (ne .Params.Description "") -}}
+ {{- $description = print .Params.Description -}}
+ {{- else if and (.Params.Summary ) (ne .Params.Summary "") -}}
+ {{- $description = print .Params.Summary -}}
+ {{- else -}}
+ {{- $description = print .Summary -}}
+ {{- end -}}
+{{- end -}}
+
+{{- $description | plainify | safeHTML | chomp | truncate 180 -}}