First work on actual site contents.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const HighlightJS = require('highlight.js')
|
||||
const EleventyVitePlugin = require('@11ty/eleventy-plugin-vite')
|
||||
const { useDocument } = require('@terrace/js/document')
|
||||
const { createFileReader } = require('@terrace/js/readers/node-readline')
|
||||
@@ -15,12 +16,27 @@ module.exports = function (config) {
|
||||
async compile(content) {
|
||||
return async () => content
|
||||
},
|
||||
async getData(inputPath) {
|
||||
getData(inputPath) {
|
||||
const doc = useDocument(createFileReader(inputPath))
|
||||
return await parsePage(doc)
|
||||
return parsePage(doc)
|
||||
}
|
||||
})
|
||||
|
||||
HighlightJS.registerLanguage('terrace', () => ({
|
||||
name: 'Terrace',
|
||||
contains: [
|
||||
{
|
||||
className: 'keyword',
|
||||
begin: /^\s*(.*?)(?:\s|$)/,
|
||||
relevance: 1
|
||||
}
|
||||
]
|
||||
}))
|
||||
|
||||
config.addFilter("highlight", function(value, language) {
|
||||
return HighlightJS.highlight(value, { language }).value
|
||||
})
|
||||
|
||||
return {
|
||||
dir: {
|
||||
input: 'src',
|
||||
|
||||
Reference in New Issue
Block a user