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

github.com/jesselau76/hugo-w3-simple.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjesselau76 <40444824+jesselau76@users.noreply.github.com>2019-02-09 08:19:33 +0300
committerGitHub <noreply@github.com>2019-02-09 08:19:33 +0300
commit6b51fac125d68a2d4ba463d161968952b8b10d10 (patch)
tree5fd94159247999162b04d7f695c9fbbd829c3be5
parente4ea4e80164969e819f79f88b71b71faccf94a94 (diff)
parentca464e2095ef5baf8a19bfdb2039a04675a80bf5 (diff)
Merge pull request #4 from clintonmasters/master
New feature: Add more control of summaries like hugo-xmag.
-rw-r--r--layouts/_default/list.html18
1 files changed, 9 insertions, 9 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index c128195..0669cb2 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -56,16 +56,16 @@
<div class="w3-container wraptext w3-white">
<code> {{ .Date.Format "2006/01/02" }} </code>
-
-
- {{ if gt (len .Summary) 200 }}
-
-
- <p>{{substr .Summary 0 200 }}...</p>
-
-
- {{ end }}
+ <p>
+ {{ with .Description }}
+ {{ $.Scratch.Set "summary" (markdownify .) }}
+ {{ else }}
+ {{ $.Scratch.Set "summary" ((delimit (findRE "(<p.*?>(.|\n)*?</p>\\s*)+" .Content) "[&hellip;] ") | plainify | truncate (default 200 .Site.Params.summary_length) (default " &hellip;" .Site.Params.text.truncated ) | replaceRE "&amp;" "&" | safeHTML) }}
+ {{ end }}
+ {{ $.Scratch.Get "summary" }}
+ </p>
+
</div>
<footer >