From dfd8a31ea8f0025c0745957aae7093df5b651739 Mon Sep 17 00:00:00 2001 From: Kaligule Date: Tue, 18 Feb 2020 13:40:54 +0100 Subject: If post has no description, use the summary instead (#83) * If post has no description, use the summary instead The summary is generated automatically from hugo. This could make transitioning to massively from a theme that doesn't require descriptions of posts much easier. * If featured post has no description, use the summary instead The summary is generated automatically from hugo. This could make transitioning to massively from a theme that doesn't require descriptions of posts much easier. --- layouts/partials/posts/featured.html | 4 ++++ layouts/partials/posts/list.html | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/layouts/partials/posts/featured.html b/layouts/partials/posts/featured.html index 0ad0203..c0a92ae 100644 --- a/layouts/partials/posts/featured.html +++ b/layouts/partials/posts/featured.html @@ -7,7 +7,11 @@ {{ .Date.Format (.Site.Params.DateFormat | default "January 2, 2006") }} {{ end }}

{{ .Title }}

+ {{ if .Description }}

{{ .Description }}

+ {{ else }} +

{{ .Summary }}

+ {{ end }} {{ if .Params.image }} diff --git a/layouts/partials/posts/list.html b/layouts/partials/posts/list.html index 72c4063..8c6ec50 100644 --- a/layouts/partials/posts/list.html +++ b/layouts/partials/posts/list.html @@ -12,7 +12,11 @@ {{ if .Params.image }} {{ end }} + {{ if .Description }}

{{ .Description }}

+ {{ else }} +

{{ .Summary }}

+ {{ end }} -- cgit v1.2.3