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.
This commit is contained in:
liushuyu 2021-01-12 18:02:05 -07:00
parent cd51353e9b
commit 2ec9c0a702
No known key found for this signature in database
GPG key ID: 23D1CE4534419437

View file

@ -6,7 +6,7 @@
<div> <div>
<span class="title px-md py-sm">{{ .Title }}</span> <span class="title px-md py-sm">{{ .Title }}</span>
</div> </div>
{{ if and $author $coauthors }} {{ if and $author (gt (len $coauthors) 1) }}
<div> <div>
<p class="h3 px-md py-sm"> <p class="h3 px-md py-sm">
Written by <a href="https://community.citra-emu.org/users/{{ $author.key }}">{{ $author.name }}</a> Written by <a href="https://community.citra-emu.org/users/{{ $author.key }}">{{ $author.name }}</a>