Fixing edge cases with missing tags and data

This commit is contained in:
Shan Carter
2017-01-06 16:20:04 -08:00
parent 037996bd06
commit 6b93782533
8 changed files with 70 additions and 60 deletions
+10 -7
View File
@@ -1,6 +1,6 @@
export default function(dom, data) {
let head = dom.querySelector("head");
appendHtml(head, `
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<link rel="icon" type="image/png" href="/favicon.png">
@@ -62,12 +62,15 @@ export default function(dom, data) {
`)
});
Object.keys(data.citations).forEach(key => {
console.log(key);
appendHtml(head, `
<meta name="citation_reference" content="${citation_meta_content(data.citations[key])}" >
`);
});
if (data.citations) {
let citationKeys = Object.keys(data.citations);
citationKeys.forEach(key => {
console.log(key);
appendHtml(head, `
<meta name="citation_reference" content="${citation_meta_content(data.citations[key])}" >
`);
});
}
}