{{.ContentHTML}}
+{{ parseContent $board.Actor $opId .Content $thread }}
From b413f9a7d72284a05d8802f06c51e4a23771d95d Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Fri, 30 Jul 2021 17:10:02 -0700 Subject: moved parseContent to template to cut down on unnecessary loops --- static/posts.html | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'static') diff --git a/static/posts.html b/static/posts.html index 67a755c..928a51d 100644 --- a/static/posts.html +++ b/static/posts.html @@ -2,6 +2,7 @@ {{ $board := .Board }} {{ $len := len .Posts }} {{ range .Posts }} +{{ $thread := . }} {{ $opId := .Id }} {{ if eq $board.InReplyTo "" }}
{{.ContentHTML}}
+{{ parseContent $board.Actor $opId .Content $thread }}
{{ if .Replies }} {{ $replies := .Replies }} {{ if gt $replies.TotalItems 5 }} {{ if gt $len 1 }} - {{ $replies.TotalItems }} replies{{ if gt $replies.TotalImgs 0}} and {{ $replies.TotalImgs }} images{{ end }}, Click here to view all. + {{ $replies.TotalItems }} replies{{ if gt $replies.TotalImgs 0}} and {{ $replies.TotalImgs }} images{{ end }}, Click here to view all. {{ end }} {{ end }} {{ range $replies.OrderedItems }} -{{.ContentHTML}}
+{{ parseContent $board.Actor $opId .Content $thread }}