1
0
Fork 0
mirror of https://github.com/Alamantus/Lexiconga.git synced 2025-04-30 07:12:59 +02:00
Lexiconga/src/pages/generic.js

18 lines
631 B
JavaScript

const marked = require('marked');
const overrides = require('require-overrides');
overrides.set('uhtml', 'uhtml-ssr'); // Replace instances of `uhtml` with `uhtml-ssr` so Node can return strings from the generated html
const { render } = require('uhtml-ssr');
module.exports = (title, description, content) => `<!DOCTYPE html>
<html lang="en">
${render(String, require('../elements/head')(title, description))}
<body class="defaultTheme">
${render(String, require('../elements/body/header')())}
<main>
<article>
${marked.parse(content)}
</article>
</main>
${render(String, require('../elements/body/footer')())}
</body>
</html>`;