diff options
Diffstat (limited to 'webserver.js')
| -rwxr-xr-x | webserver.js | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/webserver.js b/webserver.js index 98a9640..b0d5578 100755 --- a/webserver.js +++ b/webserver.js @@ -106,23 +106,35 @@ function padLeft(s, len, fill) { function buildPublicationsHTML(info) { let res = ""; for (const obj of info.pubs) { - if (res.length != 0) res += "\n\t\t\t"; + if (res.length != 0) res += "\n\t\t"; const seen = new Map(); - res += "<li>"; + res += "<tr>"; - res += obj.year; + res += "<td>" + obj.year; seen.set("year", true); if ("month" in obj) res += "-" + padLeft(obj.month + "", 2, "0") seen.set("month", true); - res += " "; + if ("conference" in obj) { + const idx = obj.conference.lastIndexOf(" "); + if (idx != -1 && !isNaN(+obj.conference.slice(idx+1))) + res += "<br><span class=\"pubs-at\">(" + obj.conference.slice(0, idx) + ")</span>"; + else res += "<br><span class=\"pubs-at\">(" + obj.conference + ")</span>"; + } + if ("journal" in obj) res += "<br><span class=\"pubs-at\">(" + obj.journal + ")</span>"; + if ("preprint" in obj) res += "<br><span class=\"pubs-at\">(preprint)</span>"; + if ("thesis" in obj) { res += "<br><span class=\"pubs-at\">(thesis)</span>"; seen.set("thesis", true); } + res += "</td>"; + + res += "<td><span class=\"pubs-authors\">"; res += obj.authors.map(key => key in info.authors ? info.authors[key] : key).join(", "); seen.set("authors", true); + res += ".</span><br>"; - res += ": “" + obj.title + "”."; + res += "“<span class=\"pubs-title\">" + obj.title + "</span>”<br>"; seen.set("title", true); if ("conference" in obj) res += " At " + obj.conference + "."; @@ -141,7 +153,7 @@ function buildPublicationsHTML(info) { seen.set("note", true); if ("links" in obj && obj.links.length > 0) { - res += " ["; + res += "<br>["; const anchors = []; for (const link of obj.links) { let name, url; @@ -177,7 +189,7 @@ function buildPublicationsHTML(info) { } seen.set("links", true); - res += "</li>"; + res += "</td></tr>"; for (const key in obj) { if (!seen.has(key)) { |
