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

github.com/curttimson/hugo-theme-massively.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaligule <Code@schauderbasis.de>2020-02-18 15:40:54 +0300
committerGitHub <noreply@github.com>2020-02-18 15:40:54 +0300
commitdfd8a31ea8f0025c0745957aae7093df5b651739 (patch)
tree634faee9050ed803470833da67e4bea7ba590582
parentb486b3d83b9ff134944c6f1e9ad6a9ba0aee4806 (diff)
If post has no description, use the summary instead (#83)v6.1.0
* 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.
-rw-r--r--layouts/partials/posts/featured.html4
-rw-r--r--layouts/partials/posts/list.html4
2 files changed, 8 insertions, 0 deletions
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 @@
<span class="date">{{ .Date.Format (.Site.Params.DateFormat | default "January 2, 2006") }}</span>
{{ end }}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
+ {{ if .Description }}
<p>{{ .Description }}</p>
+ {{ else }}
+ <p>{{ .Summary }}</p>
+ {{ end }}
</header>
{{ if .Params.image }}
<a href="{{ .Permalink }}" class="image main"><img src="{{ .Params.image | relURL }}" alt="" /></a>
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 }}
<a href="{{ .Permalink }}" class="image fit"><img src="{{ .Params.image | relURL }}" alt="" /></a>
{{ end }}
+ {{ if .Description }}
<p>{{ .Description }}</p>
+ {{ else }}
+ <p>{{ .Summary }}</p>
+ {{ end }}
<ul class="actions">
<li><a href="{{ .Permalink }}" class="button">{{ $data.post.linktext }}</a></li>
</ul>