export default function(dom, data) {
let head = dom.querySelector("head");
appendHtml(head, `
${data.title}
`);
appendHtml(head, `
`);
data.authors.forEach((a) => {
appendHtml(head, `
`)
});
appendHtml(head, `
`);
appendHtml(head, `
`);
appendHtml(head, `
`);
data.authors.forEach((a) => {
appendHtml(head, `
`)
});
if (data.citations) {
let citationKeys = Object.keys(data.citations);
citationKeys.forEach(key => {
console.log(key);
appendHtml(head, `
`);
});
}
}
function appendHtml(el, html) {
el.innerHTML += html;
}
function citation_meta_content(ref){
var content = `citation_title=${ref.title};`;
ref.author.split(" and ").forEach(author => {
content += `citation_author=${author.trim()};`;
});
if ("journal" in ref){
content += `citation_journal_title=${ref.journal};`;
}
if ("volume" in ref) {
content += `citation_volume=${ref.volume};`;
}
if ("issue" in ref || "number" in ref){
content += `citation_number=${ref.issue || ref.number};`;
}
/*content += `citation_first_page=${};`;
content += `citation_publication_date=${};`;*/
return content;
}