diff options
author | Yihui Xie <xie@yihui.name> | 2017-08-22 01:18:36 +0300 |
---|---|---|
committer | Yihui Xie <xie@yihui.name> | 2017-08-22 01:18:36 +0300 |
commit | 57bc2459e262b3106c4ac352f8f5c06dc0cbbcc5 (patch) | |
tree | ac651bf7b09a5038935fe957bbe08896a2f41227 | |
parent | dcb90d489cfc0d4500b2e4452841a8190cb9b30a (diff) |
use description as the summary if it is provided
-rw-r--r-- | layouts/_default/list.html | 4 |
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*)+") "[…] ") }} {{ end }} |