From 8d2492e6c8b350cfd0b47715e4675967408f6a01 Mon Sep 17 00:00:00 2001 From: samuel-p Date: Sun, 13 Jun 2021 01:09:52 +0200 Subject: [PATCH] major improvements --- .eleventy.js | 9 +++------ package.json | 2 +- src/_includes/donations-current.html | 5 +++-- src/_includes/donations.html | 4 ++-- src/_includes/expenses-current.html | 8 ++++---- src/de/all-donations.html | 2 +- src/de/donate.html | 4 ++-- src/de/imprint.html | 2 +- src/de/index.html | 4 ++-- src/en/all-donations.html | 2 +- src/en/donate.html | 4 ++-- src/en/imprint.html | 2 +- src/en/index.html | 4 ++-- 13 files changed, 25 insertions(+), 27 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index f330d76..67d1c3d 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,10 +1,6 @@ const eleventyNavigationPlugin = require("@11ty/eleventy-navigation"); module.exports = function (eleventyConfig) { - eleventyConfig.setLiquidOptions({ - dynamicPartials: true, - // strict_filters: true, - }); eleventyConfig.addWatchTarget("./src/scss/"); eleventyConfig.addPlugin(eleventyNavigationPlugin); @@ -27,8 +23,9 @@ module.exports = function (eleventyConfig) { 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("amount", function (value) { + // TODO update language dynamically + return value.toLocaleString('de', {minimumFractionDigits: 2}); }); eleventyConfig.addFilter("banktransfers", function (donations) { diff --git a/package.json b/package.json index 3fff056..8fb77eb 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "browser-sync": "^2.26.14" }, "devDependencies": { - "@11ty/eleventy": "^0.12.1", + "@11ty/eleventy": "^1.0.0-canary.32", "@11ty/eleventy-navigation": "^0.2.0", "cpx": "^1.5.0", "node-sass": "^6.0.0", diff --git a/src/_includes/donations-current.html b/src/_includes/donations-current.html index dc9e88e..30ed4b5 100644 --- a/src/_includes/donations-current.html +++ b/src/_includes/donations-current.html @@ -1,3 +1,4 @@ +{{locale}} @@ -21,14 +22,14 @@ {% else %} {% endif %} - + {% endfor %} - +
***{{donation.amount | amount(locale)}} €{{donation.amount | amount}} €
{{strings.total[locale]}}{{donations[0].donations | sum | amount(locale)}} €{{donations[0].donations | sum | amount}} €
diff --git a/src/_includes/donations.html b/src/_includes/donations.html index 685dc46..295f4a7 100644 --- a/src/_includes/donations.html +++ b/src/_includes/donations.html @@ -24,14 +24,14 @@ {% else %} *** {% endif %} - {{donation.amount | amount(locale)}} € + {{donation.amount | amount}} € {% endfor %} {{strings.total[locale]}} - {{year.donations | sum | amount(locale)}} € + {{year.donations | sum | amount}} € diff --git a/src/_includes/expenses-current.html b/src/_includes/expenses-current.html index 2810feb..ba6c5fd 100644 --- a/src/_includes/expenses-current.html +++ b/src/_includes/expenses-current.html @@ -18,16 +18,16 @@ {% endif %} {{expense.type}} {{expense.provider}} - {{expense.amount | amount(locale)}} € - {{expense.amount | year | amount(locale)}} € + {{expense.amount | amount}} € + {{expense.amount | year | amount}} € {% endfor %} {{strings.total[locale]}} - {{expenses | sum | amount(locale)}} € - {{expenses | sum | year | amount(locale)}} € + {{expenses | sum | amount}} € + {{expenses | sum | year | amount}} € diff --git a/src/de/all-donations.html b/src/de/all-donations.html index 2533d03..baabeaf 100644 --- a/src/de/all-donations.html +++ b/src/de/all-donations.html @@ -7,4 +7,4 @@ title: Unterstützen

➔ Unterstützen

-{% include "donations.html" %} +{% include donations.html %} diff --git a/src/de/donate.html b/src/de/donate.html index 9ed35a9..20aa190 100644 --- a/src/de/donate.html +++ b/src/de/donate.html @@ -73,10 +73,10 @@ eleventyNavigation:

Aktuelle Ausgaben

-{% include "expenses-current.html" %} +{% include expenses-current.html %}

Spenden {{donations[0].year}}

-{% include "donations-current.html" %} +{% include donations-current.html %}

➔ Alle Spenden

diff --git a/src/de/imprint.html b/src/de/imprint.html index 57c01fd..25ceb5a 100644 --- a/src/de/imprint.html +++ b/src/de/imprint.html @@ -28,5 +28,5 @@ title: Impressum

Lizenzen

Diese Webseite nutzt die folgenden Bibliotheken mit ihren entsprechenden Lizenzen:

- {% include "licenses.html" %} + {% include licenses.html %}
diff --git a/src/de/index.html b/src/de/index.html index 0d667c2..bc399f4 100644 --- a/src/de/index.html +++ b/src/de/index.html @@ -31,7 +31,7 @@ eleventyNavigation: href="https://social.sp-codes.de/@sp_codes">@sp_codes@social.sp-codes.de

- {% include "services-simple.html" %} + {% include services-simple.html %}
@@ -44,4 +44,4 @@ eleventyNavigation:

-{% include "profiles.html" %} +{% include profiles.html %} diff --git a/src/en/all-donations.html b/src/en/all-donations.html index de75659..e6dbee1 100644 --- a/src/en/all-donations.html +++ b/src/en/all-donations.html @@ -7,4 +7,4 @@ title: Unterstützen

➔ Donate

-{% include "donations.html" %} +{% include donations.html %} diff --git a/src/en/donate.html b/src/en/donate.html index 9dafa2c..79db91c 100644 --- a/src/en/donate.html +++ b/src/en/donate.html @@ -71,10 +71,10 @@ eleventyNavigation:

Current Expenses

-{% include "expenses-current.html" %} +{% include expenses-current.html %}

Donations {{donations[0].year}}

-{% include "donations-current.html" %} +{% include donations-current.html %}

➔ All Donations

diff --git a/src/en/imprint.html b/src/en/imprint.html index dad79ec..63fbad5 100644 --- a/src/en/imprint.html +++ b/src/en/imprint.html @@ -28,5 +28,5 @@ title: sp-codes

Licenses

This Website uses the following libraries with their respective licenses:

- {% include "licenses.html" %} + {% include licenses.html %}
diff --git a/src/en/index.html b/src/en/index.html index 342a5fa..7d15540 100644 --- a/src/en/index.html +++ b/src/en/index.html @@ -30,7 +30,7 @@ eleventyNavigation: href="https://social.sp-codes.de/@sp_codes">@sp_codes@social.sp-codes.de

- {% include "services-simple.html" %} + {% include services-simple.html %}
@@ -44,4 +44,4 @@ eleventyNavigation: -{% include "profiles.html" %} +{% include profiles.html %}