From 2ec9c0a702d58ca58835803bd8d2e7b15618a67c Mon Sep 17 00:00:00 2001 From: liushuyu Date: Tue, 12 Jan 2021 18:02:05 -0700 Subject: [PATCH] layouts/entry/single: fix a bug where ... ... if there is no co-author, there will be an extra "and" at the end. Hugo seems to treat empty array as "true" when doing logical operations. --- layouts/entry/single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/entry/single.html b/layouts/entry/single.html index 7f4b425..55f7294 100644 --- a/layouts/entry/single.html +++ b/layouts/entry/single.html @@ -6,7 +6,7 @@
{{ .Title }}
- {{ if and $author $coauthors }} + {{ if and $author (gt (len $coauthors) 1) }}

Written by {{ $author.name }}