Files
template/components/include.js
T
Christopher Olah 9a99c0726f small fixes to meta
2017-01-09 10:27:37 -08:00

19 lines
434 B
JavaScript

import fetch from "fetch";
let fetchUrl = fetch.fetchUrl
export default function(dom, data) {
var includeTags = [].slice.apply(dom.querySelectorAll("dt-include"));
includeTags.forEach(el => {
let src = el.getAttribute("src");
fetchUrl(src, (err, meta, body) => {
console.log(err, meta, body);
el.innerHTML = body.toString();
})
});
data.bibliography = bibliography;
data.citations = citations;
}