diff options
author | Andrei Mackenzie <andrei@clypd.com> | 2021-07-06 01:26:39 +0300 |
---|---|---|
committer | Andrei Mackenzie <andrei@clypd.com> | 2021-07-08 05:02:22 +0300 |
commit | ca6a0a515285e6514ba96716186d4f397a77e1d1 (patch) | |
tree | 7329853b07d15c3ca1fb4147d1c8c82951eaab2e | |
parent | a52fb788356e417036c631ebb4ccb2a34b8f78bc (diff) |
Fix markdown rendering in post previews
RawContent contains unprocessed Markdown, which appears messy in the
index and post list pages. Replace this with the plaintext post content.
-rw-r--r-- | layouts/partials/post-preview.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/partials/post-preview.html b/layouts/partials/post-preview.html index a191248..d9e1765 100644 --- a/layouts/partials/post-preview.html +++ b/layouts/partials/post-preview.html @@ -12,10 +12,10 @@ <span class="description"> {{ if isset .Params "description" }} {{ .Description }} - {{ else if gt (countrunes .RawContent) 120 }} - {{ slicestr .RawContent 0 120 }}... + {{ else if gt (countrunes (.Content | plainify)) 120 }} + {{ slicestr (.Content | plainify) 0 120 }}... {{ else }} - {{ .RawContent }} + {{ .Content | plainify }} {{ end }} </span> </div> |