added expenses and donations replaced some icons with svgs
This commit is contained in:
parent
c5b781fde1
commit
a5aa3cc014
41 changed files with 428 additions and 95 deletions
36
.eleventy.js
36
.eleventy.js
|
@ -1,6 +1,10 @@
|
|||
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
|
||||
|
||||
module.exports = function(eleventyConfig) {
|
||||
module.exports = function (eleventyConfig) {
|
||||
eleventyConfig.setLiquidOptions({
|
||||
dynamicPartials: true,
|
||||
// strict_filters: true,
|
||||
});
|
||||
eleventyConfig.addWatchTarget("./src/scss/");
|
||||
|
||||
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
||||
|
@ -11,10 +15,38 @@ module.exports = function(eleventyConfig) {
|
|||
"node_modules/@fortawesome/fontawesome-free/webfonts/": "font",
|
||||
"node_modules/flag-icon-css/flags/4x3/(de|us)*": "flags"
|
||||
});
|
||||
eleventyConfig.addShortcode("translatedUrl", function(currentLocale, newLocale) {
|
||||
eleventyConfig.addShortcode("translatedUrl", function (currentLocale, newLocale) {
|
||||
return this.page.url.replace(new RegExp(`\/${currentLocale}\/`), `/${newLocale}/`);
|
||||
});
|
||||
|
||||
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;
|
||||
});
|
||||
|
||||
return {
|
||||
dir: {
|
||||
input: "src",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue