Browse Source

major improvements

pull/67/head
Samuel Philipp 11 months ago
parent
commit
8d2492e6c8
Signed by: samuel-p
GPG Key ID: 2AD495D17760CB4E
  1. 9
      .eleventy.js
  2. 2
      package.json
  3. 5
      src/_includes/donations-current.html
  4. 4
      src/_includes/donations.html
  5. 8
      src/_includes/expenses-current.html
  6. 2
      src/de/all-donations.html
  7. 4
      src/de/donate.html
  8. 2
      src/de/imprint.html
  9. 4
      src/de/index.html
  10. 2
      src/en/all-donations.html
  11. 4
      src/en/donate.html
  12. 2
      src/en/imprint.html
  13. 4
      src/en/index.html

9
.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) {

2
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",

5
src/_includes/donations-current.html

@ -1,3 +1,4 @@
{{locale}}
<table class="table">
<thead>
<tr>
@ -21,14 +22,14 @@
{% else %}
<td>***</td>
{% endif %}
<td>{{donation.amount | amount(locale)}} €</td>
<td>{{donation.amount | amount}} €</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th colspan="3">{{strings.total[locale]}}</th>
<th>{{donations[0].donations | sum | amount(locale)}} €</th>
<th>{{donations[0].donations | sum | amount}} €</th>
</tr>
</tfoot>
</table>

4
src/_includes/donations.html

@ -24,14 +24,14 @@
{% else %}
<td>***</td>
{% endif %}
<td>{{donation.amount | amount(locale)}} €</td>
<td>{{donation.amount | amount}} €</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th colspan="3">{{strings.total[locale]}}</th>
<th>{{year.donations | sum | amount(locale)}} €</th>
<th>{{year.donations | sum | amount}} €</th>
</tr>
</tfoot>
</table>

8
src/_includes/expenses-current.html

@ -18,16 +18,16 @@
{% endif %}
<td>{{expense.type}}</td>
<td>{{expense.provider}}</td>
<td>{{expense.amount | amount(locale)}} €</td>
<td>{{expense.amount | year | amount(locale)}} €</td>
<td>{{expense.amount | amount}} €</td>
<td>{{expense.amount | year | amount}} €</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th colspan="3">{{strings.total[locale]}}</th>
<th>{{expenses | sum | amount(locale)}} €</th>
<th>{{expenses | sum | year | amount(locale)}} €</th>
<th>{{expenses | sum | amount}} €</th>
<th>{{expenses | sum | year | amount}} €</th>
</tr>
</tfoot>
</table>

2
src/de/all-donations.html

@ -7,4 +7,4 @@ title: Unterstützen
<p><a href="/{{locale}}/donate/">&#10132; Unterstützen</a></p>
{% include "donations.html" %}
{% include donations.html %}

4
src/de/donate.html

@ -73,10 +73,10 @@ eleventyNavigation:
</div>
<h2>Aktuelle Ausgaben</h2>
{% include "expenses-current.html" %}
{% include expenses-current.html %}
<h2>Spenden {{donations[0].year}}</h2>
{% include "donations-current.html" %}
{% include donations-current.html %}
<p><a href="/{{locale}}/all-donations/">&#10132; Alle Spenden</a></p>

2
src/de/imprint.html

@ -28,5 +28,5 @@ title: Impressum
<div class="mb-3 pt-4 border-top">
<h2>Lizenzen</h2>
<p>Diese Webseite nutzt die folgenden Bibliotheken mit ihren entsprechenden Lizenzen:</p>
{% include "licenses.html" %}
{% include licenses.html %}
</div>

4
src/de/index.html

@ -31,7 +31,7 @@ eleventyNavigation:
href="https://social.sp-codes.de/@sp_codes">@sp_codes@social.sp-codes.de</a></strong>
</p>
<div class="row justify-content-center">
{% include "services-simple.html" %}
{% include services-simple.html %}
</div>
</div>
</div>
@ -44,4 +44,4 @@ eleventyNavigation:
</p>
</div>
</div>
{% include "profiles.html" %}
{% include profiles.html %}

2
src/en/all-donations.html

@ -7,4 +7,4 @@ title: Unterstützen
<p><a href="/{{locale}}/donate/">&#10132; Donate</a></p>
{% include "donations.html" %}
{% include donations.html %}

4
src/en/donate.html

@ -71,10 +71,10 @@ eleventyNavigation:
</div>
<h2>Current Expenses</h2>
{% include "expenses-current.html" %}
{% include expenses-current.html %}
<h2>Donations {{donations[0].year}}</h2>
{% include "donations-current.html" %}
{% include donations-current.html %}
<p><a href="/{{locale}}/all-donations/">&#10132; All Donations</a></p>

2
src/en/imprint.html

@ -28,5 +28,5 @@ title: sp-codes
<div class="mb-3 pt-4 border-top">
<h2>Licenses</h2>
<p>This Website uses the following libraries with their respective licenses:</p>
{% include "licenses.html" %}
{% include licenses.html %}
</div>

4
src/en/index.html

@ -30,7 +30,7 @@ eleventyNavigation:
href="https://social.sp-codes.de/@sp_codes">@sp_codes@social.sp-codes.de</a></strong>
</p>
<div class="row justify-content-center">
{% include "services-simple.html" %}
{% include services-simple.html %}
</div>
</div>
</div>
@ -44,4 +44,4 @@ eleventyNavigation:
</div>
</div>
{% include "profiles.html" %}
{% include profiles.html %}

Loading…
Cancel
Save