<% for (const item of items) { %>
<% if (item["pub-authors"] && item["pub-authors"].length) { %>
<%
const authors = item["pub-authors"];
let authorText = "";
if (authors.length === 1) {
authorText = authors[0];
} else if (authors.length === 2) {
authorText = authors.join(" & ");
} else {
authorText = authors.slice(0, -1).join(", ") + ", & " + authors[authors.length - 1];
}
%>
<%= authorText %>
<% } %>
<% if (item["pub-year"]) { %>
<%- item["pub-year"] %>
<% } %>
<% if (item.venue) { %>
<%- item.venue %>
<% } %>
<% if (item["pub-type"]) { %>
<%- item["pub-type"] %>
<% } %>
<% if (item.pdf) { %>
Read
<% } else { %>
Read
<% } %>
<% if (item.data) { %>
Data
<% } %>
<% if (item.code) { %>
Code
<% } %>
<% } %>