28 lines
604 B
JavaScript
28 lines
604 B
JavaScript
const EleventyFetch = require("@11ty/eleventy-fetch");
|
|
const markdownIt = require('./markdown.js');
|
|
const outdent = require('outdent');
|
|
|
|
const full = (children) => {
|
|
const content = markdownIt.render(children);
|
|
return outdent`<div class="full-bleed" style="background-color: var(--surface2);margin-block:1rem;">${content}</div>`
|
|
};
|
|
|
|
const fetch = async (url, type) => {
|
|
try {
|
|
const text = await EleventyFetch(url,
|
|
{
|
|
duration: '*',
|
|
type: type
|
|
}
|
|
);
|
|
return text;
|
|
} catch (ex) {
|
|
console.log(ex);
|
|
return "";
|
|
}
|
|
};
|
|
|
|
module.exports = {
|
|
full,
|
|
fetch
|
|
}; |