From 2f6e71eb7cfaeb4bab38a987ba151df0df3d2dd3 Mon Sep 17 00:00:00 2001 From: Marc Pervaz Boocha Date: Wed, 22 Sep 2021 18:32:07 +0530 Subject: initial commit --- eleventy.config.js | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 eleventy.config.js (limited to 'eleventy.config.js') diff --git a/eleventy.config.js b/eleventy.config.js new file mode 100644 index 0000000..b2e2a5b --- /dev/null +++ b/eleventy.config.js @@ -0,0 +1,52 @@ +module.exports = eleventyConfig => { + eleventyConfig.addPlugin(require('@11ty/eleventy-plugin-syntaxhighlight')) + eleventyConfig.addPlugin(require('@11ty/eleventy-plugin-rss')) + + eleventyConfig.setLibrary('md', require('markdown-it')({ + html: true, + linkify: true, + typographer: true + }).use(require('markdown-it-attrs'))) + + eleventyConfig.addTransform('htmlmin', (content, outputPath) => { + if (outputPath && outputPath.endsWith('.html')) { + const minified = require("html-minifier").minify(content, { + useShortDoctype: true, + removeComments: true, + collapseWhitespace: true + }) + return minified + } + + return content + }) + + const { DateTime } = require('luxon') + eleventyConfig.addFilter('datefmt', date => { + return DateTime.fromJSDate(date, { zone: 'utc' }).toFormat("dd LLL yyyy"); + }) + + eleventyConfig.addPassthroughCopy('static/') + eleventyConfig.addPassthroughCopy('favicon.svg') + eleventyConfig.addPassthroughCopy('favicon.ico') + + return { + dir: { + input: 'src', + output: 'dist', + includes: 'includes', + data: 'data', + layouts: 'layouts' + }, + + dataTemplateEngine: 'njk', + markdownTemplateEngine: 'njk', + htmlTemplateEngine: 'njk', + templateFormats: [ + 'html', + 'md', + 'njk', + '11ty.js' + ] + } +} -- cgit v1.2.3-70-g09d2