work.suroh.tk/.eleventy.js

29 lines
768 B
JavaScript
Raw Normal View History

module.exports = (config) => {
// add collection for pages
config.addCollection('pages', (collection) => {
return collection.getFilteredByGlob("**/*.md");
})
// custom filters
config.addFilter("makeLowercase", (value) => {
if (typeof value === 'string' || value instanceof String) {
2019-12-07 21:49:59 +00:00
return value.toLowerCase()
}
})
// added passthrough for global assets
config.addPassthroughCopy("assets")
// added passthrough for images in their respective folders
config.addPassthroughCopy("_content/**/images/**")
// reutrn updated config
return {
dir: {
input: "_content", // content
includes: "../_includes", // templates
output: "_site", // rendered site
data: "../_data" // global data files
}
}
}