arnes.space/.eleventy.js
arne 9024c00b1a 10-print header works :)
I had to pin @thi.ng/hiccup to an earlier version because they stopped publishing CommonJS modules. There is [an issue tracking EcmaScript module support in 11ty](https://github.com/11ty/eleventy/issues/836) but it has not been fixed yet and other solutions broke unpredictably by messing with template inheritance.
2022-02-20 18:10:09 +01:00

25 lines
735 B
JavaScript

const { DateTime } = require('luxon')
const header = require('./src/_helpers/header')
module.exports = function (config) {
config.setBrowserSyncConfig({
files: './_site/assets/*.css'
})
config.addPassthroughCopy("src/assets/ibm-plex/IBM-Plex-Mono/fonts/**/*")
// template filters
config.addFilter('toJSON', obj => JSON.stringify(obj))
config.addFilter('toISODate', date => DateTime.fromJSDate(date).toISODate())
config.addFilter('header', header)
// returns classes to be used on <body>, given a page's url
config.addFilter('pageClasses', url => {
const segments = url.split('/').filter(s => s)
return segments.length ? segments.join(' ') : 'home'
})
return {
markdownTemplateEngine: "njk"
}
}