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

github.com/knadh/hugo-ink.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Mackenzie <andrei@clypd.com>2021-07-06 01:26:39 +0300
committerAndrei Mackenzie <andrei@clypd.com>2021-07-08 05:02:22 +0300
commitca6a0a515285e6514ba96716186d4f397a77e1d1 (patch)
tree7329853b07d15c3ca1fb4147d1c8c82951eaab2e
parenta52fb788356e417036c631ebb4ccb2a34b8f78bc (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.html6
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>