Finished main home page layout. Not responsive yet.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user