cerca

lean forum software (pmc local branch)
Log | Files | Refs | README | LICENSE

commit 4f8bc8068a253519c4f553f2511b3a9a165526e2
parent 1257d66c5d9e851c555e38ac56cbd4d169b58708
Author: cblgh <cblgh@cblgh.org>
Date:   Tue,  5 Dec 2023 21:32:42 +0100

display placeholder on index when starting a fresh forum

Diffstat:
Mhtml/index.html | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/html/index.html b/html/index.html @@ -1,8 +1,11 @@ {{ template "head" . }} <main> - {{ range $index, $thread := .Data.Threads }} - <h2><a href="{{$thread.Slug}}">{{ $thread.Title }}</a></h2> - {{ end }} + {{ if len .Data.Threads | eq 0 }} + <p> There are currently no threads. </p> + {{ end }} + {{ range $index, $thread := .Data.Threads }} + <h2><a href="{{$thread.Slug}}">{{ $thread.Title }}</a></h2> + {{ end }} </main> {{ if .LoggedIn }} <aside>