Finished main home page layout. Not responsive yet.

This commit is contained in:
Joshua Bemenderfer
2023-02-12 22:50:33 -05:00
parent 381aec4ba4
commit 6dce7ff031
8 changed files with 1055 additions and 20 deletions

View File

@@ -1,9 +1,21 @@
const { contentAsText } = require('../helpers.js')
const marked = require('marked')
module.exports = async (doc, rootLevel) => {
return {
type: doc.head(),
text: marked.parse(await contentAsText(doc, rootLevel))
module.exports = async function (doc, rootLevel) {
const { next, line, match, tail, level, head } = doc
const node = {
type: head(),
class: '',
text: ''
}
while (await next(rootLevel)) {
if (match('class')) node.class = tail()
else {
node.text = marked.parse(await contentAsText(doc, rootLevel, true))
}
}
return node
}