diff options
author | Patrick Collins <thepatrickcollins@gmail.com> | 2017-12-10 23:05:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-10 23:05:57 +0300 |
commit | 88c21a682b7c46d9fee39e9e58ad46df513717ed (patch) | |
tree | 610d7d6f790ed0f060d0deae1d2732d5c9019321 | |
parent | b5cc3f607c9deb2e489e759699e426f7cfbbbf8a (diff) |
Change list summary from plain text to html (#71)
-rw-r--r-- | layouts/post/content-list.html | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/layouts/post/content-list.html b/layouts/post/content-list.html index 5662909..4cfd087 100644 --- a/layouts/post/content-list.html +++ b/layouts/post/content-list.html @@ -1,12 +1,12 @@ <article class="post"> - {{ .Render "header" }} - {{ .Render "featured" }} - <p>{{ printf "%s" .Summary | markdownify }}</p> - - <footer> - <ul class="actions"> - <li><a href="{{ .RelPermalink }}" class="button big">Continue Reading</a></li> - </ul> - {{ .Render "footer-category" }} - </footer> + {{ .Render "header" }} + {{ .Render "featured" }} + {{ $.Scratch.Set "summary" ((delimit (findRE "<p.*?>(.|\n)*?</p>" .Content 1) "") | truncate (default 500 .Site.Params.summary_length) (default "…" .Site.Params.text.truncated ) | replaceRE "&" "&" | safeHTML) }} + {{ $.Scratch.Get "summary" }} + <footer> + <ul class="actions"> + <li><a href="{{ .RelPermalink }}" class="button big">Continue Reading</a></li> + </ul> + {{ .Render "footer-category" }} + </footer> </article> |