diff --git a/layouts/partials/publication.html b/layouts/partials/publication.html
index 234db7f..6fafb3a 100644
--- a/layouts/partials/publication.html
+++ b/layouts/partials/publication.html
@@ -10,16 +10,18 @@
class="w-full"/>
- {{ range $author_index, $author_val := .authors }}
- {{ if $author_val.me }}
-
- {{ end }}
- {{- $author_val.name -}}
- {{- /* Add comma if not last author */ -}}
- {{- if le $author_index (len .) -}},{{- end -}}
- {{ if $author_val.me }}
-
- {{ end }}
+ {{ with $authorlist := .authors }}
+ {{ range $author_index, $author_val := $authorlist }}
+ {{ if $author_val.me }}
+
+ {{ end }}
+ {{- $author_val.name -}}
+ {{- /* Add comma if not last author */ -}}
+ {{- if lt $author_index (sub (len $authorlist) 1) -}},{{- end -}}
+ {{ if $author_val.me }}
+
+ {{ end }}
+ {{ end }}
{{ end }}