From cfc3f2c8c067d47505e64b1445c4692316fd4eb6 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Mon, 16 May 2022 00:33:53 +0200 Subject: Introduce description partial --- layouts/partials/description.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 layouts/partials/description.html (limited to 'layouts/partials/description.html') 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 -}} -- cgit v1.2.3