2023-01-09 20:10:02 +01:00
|
|
|
'use strict';
|
2023-01-06 23:37:45 +01:00
|
|
|
|
2023-02-02 21:52:26 +01:00
|
|
|
const { EleventyRenderPlugin } = require('@11ty/eleventy');
|
2023-01-31 20:18:33 +01:00
|
|
|
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight');
|
2023-01-24 23:51:07 +01:00
|
|
|
const yaml = require('js-yaml');
|
2023-03-07 21:45:47 +01:00
|
|
|
|
2023-03-09 23:32:49 +01:00
|
|
|
const componentsPlugin =
|
|
|
|
require('./source/helpers/components/index.ts').default;
|
|
|
|
const datesPlugin = require('./source/helpers/dates.ts').default;
|
2023-03-08 21:59:19 +01:00
|
|
|
const { liquidEngine, markdownEngine } = require('./source/helpers/engines.ts');
|
2023-03-09 23:32:49 +01:00
|
|
|
const pagesPlugin = require('./source/helpers/pages.ts').default;
|
|
|
|
const typePlugin = require('./source/helpers/type.ts').default;
|
2023-01-24 23:51:07 +01:00
|
|
|
|
2023-01-06 22:40:29 +01:00
|
|
|
/** @param {import('@11ty/eleventy').UserConfig} eleventyConfig */
|
2023-01-06 23:37:45 +01:00
|
|
|
module.exports = (eleventyConfig) => {
|
2023-01-09 20:10:02 +01:00
|
|
|
eleventyConfig.addPassthroughCopy('source/assets/dist');
|
|
|
|
eleventyConfig.addPassthroughCopy('source/assets/img');
|
|
|
|
eleventyConfig.addPassthroughCopy('source/favicon.ico');
|
2023-01-06 22:40:29 +01:00
|
|
|
|
2023-01-11 18:30:24 +01:00
|
|
|
eleventyConfig.setUseGitIgnore(false);
|
2023-02-02 22:14:26 +01:00
|
|
|
eleventyConfig.watchIgnores.add('source/_data/versionCache.json');
|
2023-01-10 23:05:39 +01:00
|
|
|
|
2023-03-08 21:59:19 +01:00
|
|
|
eleventyConfig.setLibrary('liquid', liquidEngine);
|
|
|
|
eleventyConfig.setLibrary('md', markdownEngine);
|
2023-02-01 23:35:15 +01:00
|
|
|
eleventyConfig.addDataExtension('yml, yaml', (contents) =>
|
|
|
|
yaml.load(contents),
|
|
|
|
);
|
2023-01-24 23:51:07 +01:00
|
|
|
|
2023-03-09 23:32:49 +01:00
|
|
|
// register filters and shortcodes
|
|
|
|
eleventyConfig.addPlugin(componentsPlugin);
|
|
|
|
eleventyConfig.addPlugin(datesPlugin);
|
|
|
|
eleventyConfig.addPlugin(pagesPlugin);
|
|
|
|
eleventyConfig.addPlugin(typePlugin);
|
2023-02-25 13:44:14 +01:00
|
|
|
|
2023-03-09 23:32:49 +01:00
|
|
|
// other plugins
|
2023-01-29 21:04:56 +01:00
|
|
|
eleventyConfig.addPlugin(EleventyRenderPlugin);
|
2023-01-31 20:18:33 +01:00
|
|
|
eleventyConfig.addPlugin(syntaxHighlight);
|
2023-01-29 21:04:56 +01:00
|
|
|
|
2023-01-06 23:37:45 +01:00
|
|
|
// settings
|
|
|
|
return {
|
|
|
|
dir: {
|
2023-01-09 20:10:02 +01:00
|
|
|
input: 'source',
|
|
|
|
includes: '_includes',
|
|
|
|
layouts: '_layouts',
|
2023-01-06 23:37:45 +01:00
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|