From 45a8c03dc3feaedd4a7c91ba5a4d878a1c312208 Mon Sep 17 00:00:00 2001 From: Christopher Olah Date: Fri, 13 Jan 2017 13:35:05 -0800 Subject: [PATCH] fix meta --- components/meta.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/components/meta.js b/components/meta.js index e0150cd..f8b6f7b 100644 --- a/components/meta.js +++ b/components/meta.js @@ -6,7 +6,7 @@ export default function(dom, data) { function meta(name, content) { if (content) - appendHead(``); + appendHead(` \n`); } appendHead(` @@ -19,9 +19,8 @@ export default function(dom, data) { appendHead(` - - - `); + + `); // data.authors.forEach((a) => { appendHtml(head, ` `) @@ -50,8 +49,7 @@ export default function(dom, data) { `); appendHead(` - - `); + `); meta("citation_title", data.title); meta("citation_fulltext_html_url", data.url); @@ -66,12 +64,9 @@ export default function(dom, data) { meta("citation_issn", journal.issn); meta("citation_publisher", journal.publisher); - if (data.published){ + if (data.publishedDate){ let zeroPad = (n) => { return n < 10 ? "0" + n : n; }; - let publishedYear = data.published.getFullYear(); - let publishedMonthPadded = zeroPad(data.published.getMonth() + 1); - let publishedDayPadded = zeroPad(data.published.getDate()); - meta("citation_publication_date", `${publishedYear}/${publishedMonthPadded}/${publishedDayPadded}`); + meta("citation_publication_date", `${data.publishedYear}/${data.publishedMonthPadded}/${data.publishedDayPadded}`); } (data.authors || []).forEach((a) => {