2020-06-01 19:44:08 +00:00
|
|
|
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
|
|
|
|
|
2021-06-07 22:16:21 +00:00
|
|
|
module.exports = function (eleventyConfig) {
|
|
|
|
eleventyConfig.setLiquidOptions({
|
|
|
|
dynamicPartials: true,
|
|
|
|
// strict_filters: true,
|
|
|
|
});
|
2020-07-27 15:41:08 +00:00
|
|
|
eleventyConfig.addWatchTarget("./src/scss/");
|
2020-06-01 19:44:08 +00:00
|
|
|
|
|
|
|
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
|
|
|
eleventyConfig.setUseGitIgnore(false);
|
|
|
|
eleventyConfig.addPassthroughCopy({
|
2020-07-27 15:41:08 +00:00
|
|
|
"src/img": "img",
|
|
|
|
"src/font": "font",
|
2020-06-01 19:44:08 +00:00
|
|
|
"node_modules/@fortawesome/fontawesome-free/webfonts/": "font",
|
|
|
|
"node_modules/flag-icon-css/flags/4x3/(de|us)*": "flags"
|
|
|
|
});
|
2021-06-07 22:16:21 +00:00
|
|
|
eleventyConfig.addShortcode("translatedUrl", function (currentLocale, newLocale) {
|
2021-04-05 19:46:34 +00:00
|
|
|
return this.page.url.replace(new RegExp(`\/${currentLocale}\/`), `/${newLocale}/`);
|
|
|
|
});
|
2020-06-01 19:44:08 +00:00
|
|
|
|
2021-06-07 22:16:21 +00:00
|
|
|
eleventyConfig.addFilter('year', function (value) {
|
|
|
|
return value * 12;
|
|
|
|
});
|
|
|
|
|
|
|
|
eleventyConfig.addFilter("sum", function (value) {
|
|
|
|
return value.map(d => d.amount).reduce((a, b) => a + b);
|
|
|
|
});
|
|
|
|
|
|
|
|
eleventyConfig.addFilter("amount", function (value, locale) {
|
|
|
|
return value.toLocaleString(locale, {minimumFractionDigits: 2});
|
|
|
|
});
|
|
|
|
|
|
|
|
eleventyConfig.addFilter("banktransfers", function (donations) {
|
|
|
|
return donations
|
|
|
|
.flatMap(y => y.donations)
|
|
|
|
.filter(d => d.via === 'banktransfer')
|
|
|
|
.filter(d => d.first)
|
|
|
|
.length;
|
|
|
|
});
|
|
|
|
|
|
|
|
eleventyConfig.addFilter("cash", function (donations) {
|
|
|
|
return donations
|
|
|
|
.flatMap(y => y.donations)
|
|
|
|
.filter(d => d.via === 'cash')
|
|
|
|
.filter(d => d.first)
|
|
|
|
.length;
|
|
|
|
});
|
|
|
|
|
2020-06-01 19:44:08 +00:00
|
|
|
return {
|
|
|
|
dir: {
|
2020-07-27 15:41:08 +00:00
|
|
|
input: "src",
|
2020-06-01 19:44:08 +00:00
|
|
|
includes: "_includes",
|
|
|
|
layouts: "_includes/layouts",
|
|
|
|
output: "dist"
|
|
|
|
}
|
|
|
|
};
|
2020-06-03 22:04:32 +00:00
|
|
|
};
|