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

github.com/yihui/hugo-xmag.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYihui Xie <xie@yihui.name>2017-08-22 01:18:36 +0300
committerYihui Xie <xie@yihui.name>2017-08-22 01:18:36 +0300
commit57bc2459e262b3106c4ac352f8f5c06dc0cbbcc5 (patch)
treeac651bf7b09a5038935fe957bbe08896a2f41227
parentdcb90d489cfc0d4500b2e4452841a8190cb9b30a (diff)
use description as the summary if it is provided
-rw-r--r--layouts/_default/list.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 752be70..776d677 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -29,8 +29,8 @@
<div class="thumbnail">{{ (print . " alt=\"Thumbnail\" />") | safeHTML }}</div>
{{ end }}
{{ end }}
- {{ if and .Description (or .Params.use_description .Site.Params.use_description) }}
- {{ $.Scratch.Set "summary" .Description }}
+ {{ with .Description }}
+ {{ $.Scratch.Set "summary" . }}
{{ else }}
{{ $.Scratch.Set "summary" (delimit (.Content | findRE "(<p.*?>(.|\n)*?</p>\\s*)+") "[&hellip;] ") }}
{{ end }}