From 16d5fa039ee5b96668d288bbd7cddd9298da9af1 Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Thu, 20 Jan 2022 20:45:47 +0200 Subject: [PATCH] feat: add post text slice if too big on threads list --- templates/index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/index.html b/templates/index.html index c343433..3d46276 100644 --- a/templates/index.html +++ b/templates/index.html @@ -35,7 +35,14 @@ {{ if ne $Post.Title "" }}
{{$Post.Title}}
{{ end }} + + {{ $textLength := len $Post.Text }} + {{ if gt $textLength 300 }} +

{{ slice $Post.Text 0 300 }} ...

+ {{ else }}

{{$Post.Text}}

+ {{ end }} + Open