From a122b0e3acf77ace4729ca1c5db02724696ce238 Mon Sep 17 00:00:00 2001 From: Samuel Philipp Date: Sun, 31 Mar 2024 00:09:47 +0100 Subject: [PATCH] major improvements strings refactoring improved og tags (see #57) --- src/_data/global.json | 19 +++ src/_data/site.js | 23 +-- src/_data/strings.json | 136 ------------------ src/_includes/donations-current.html | 12 +- src/_includes/donations.html | 12 +- src/_includes/expenses-current.html | 14 +- src/_includes/layouts/article.njk | 16 +-- src/_includes/layouts/base.njk | 35 ++--- src/_includes/layouts/service.njk | 4 +- .../{services-extended.html => services.html} | 2 +- src/de/all-donations.html | 1 + src/de/contact.html | 1 + src/de/de.json | 45 +++++- src/de/donate.html | 11 +- src/de/imprint.html | 1 + src/de/index.html | 4 +- src/de/privacy.html | 1 + src/de/services.html | 3 +- src/en/all-donations.html | 3 +- src/en/contact.html | 1 + src/en/donate.html | 9 +- src/en/en.json | 46 +++++- src/en/imprint.html | 3 +- src/en/index.html | 4 +- src/en/privacy.html | 1 + src/en/services.html | 3 +- 26 files changed, 188 insertions(+), 222 deletions(-) create mode 100644 src/_data/global.json delete mode 100644 src/_data/strings.json rename src/_includes/{services-extended.html => services.html} (73%) diff --git a/src/_data/global.json b/src/_data/global.json new file mode 100644 index 0000000..1263fe0 --- /dev/null +++ b/src/_data/global.json @@ -0,0 +1,19 @@ +{ + "title": "sp-codes", + "description": "Samuel Philipp - Software Engineer from Magdeburg", + "url": "https://sp-codes.de", + "baseUrl": "/", + "author": "Samuel Philipp", + "languages": [ + { + "label": "English", + "code": "en", + "icon": "us" + }, + { + "label": "Deutsch", + "code": "de", + "icon": "de" + } + ] +} diff --git a/src/_data/site.js b/src/_data/site.js index a4c5cf4..3c5f555 100644 --- a/src/_data/site.js +++ b/src/_data/site.js @@ -1,20 +1,3 @@ -module.exports = { - title: "sp-codes", - description: "Samuel Philipp - Software Engineer from Magdeburg", - url: "https://sp-codes.de", - baseUrl: "/", - author: "Samuel Philipp", - buildTime: new Date(), - languages: [ - { - label: "English", - code: "en", - icon: "us" - }, - { - label: "Deutsch", - code: "de", - icon: "de" - } - ] -}; +const site = require("./global.json"); +site.buildTime = new Date(); +module.exports = site; diff --git a/src/_data/strings.json b/src/_data/strings.json deleted file mode 100644 index 098bfea..0000000 --- a/src/_data/strings.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "menu": { - "title": { - "de": "Menü", - "en": "Menu" - }, - "imprint": { - "de": "Impressum", - "en": "Imprint" - }, - "privacy": { - "de": "Datenschutz", - "en": "Privacy" - }, - "code": { - "de": "Code", - "en": "Code" - }, - "stats": { - "de": "Statistiken", - "en": "Stats" - } - }, - "state": { - "title": { - "de": "Status", - "en": "State" - }, - "operational": { - "de": "Online", - "en": "Online" - }, - "outage": { - "de": "Ausfall", - "en": "Outage" - }, - "maintenance": { - "de": "Wartung", - "en": "Maintenance" - } - }, - "donations": { - "supporters": { - "de": "Unterstützende", - "en": "Supporters" - }, - "date": { - "de": "Datum", - "en": "Date" - }, - "amount": { - "de": "Betrag", - "en": "Amount" - }, - "via": { - "de": "Via", - "en": "Via" - }, - "from": { - "de": "Von", - "en": "Form" - }, - "banktransfer": { - "de": "Überweisung", - "en": "Bank transfer" - }, - "opencollective": { - "de": "Open Collective", - "en": "Open Collective" - }, - "total": { - "de": "Gesamt", - "en": "Total" - }, - "name": { - "de": "Name", - "en": "Name" - }, - "type": { - "de": "Typ", - "en": "Type" - }, - "provider": { - "de": "Anbieter", - "en": "Provider" - }, - "location": { - "de": "Standort", - "en": "Location" - }, - "month": { - "de": "Monat", - "en": "Month" - }, - "year": { - "de": "Jahr", - "en": "Year" - } - }, - "service": { - "overview": { - "de": "Zurück zur Übersicht", - "en": "Back to overview" - } - }, - "article": { - "seriesParts": { - "de": "Alle Teile dieser Serie", - "en": "All parts of this series" - }, - "relatedService": { - "de": "Zugehöriger Dienst", - "en": "Related Service" - }, - "questions": { - "de": "Du hast eine Frage dazu?", - "en": "Do you have a question?" - }, - "questionsContent": { - "de": "

Komm gerne in der Matrix-Gruppe vorbei und lass uns diskutieren. Ich freue mich auf dein Feedback!

#sp-codes:matrix.sp-codes.de", - "en": "

Join the Matrix group and let's discuss. I look forward to your feedback!

#sp-codes:matrix.sp-codes.de" - }, - "aboutMe": { - "de": "Über mich", - "en": "About me" - }, - "aboutMeContent": { - "de": "

Mein Name ist Samuel Philipp und ich bin ein Software Engineer aus Magdeburg. In meiner Freizeit hoste ich verschiedene freie Dienste. Hier schreibe ich Artikel rund um Sicherheit und Datenschutz.

Mehr erfahren", - "en": "

My name is Samuel Philipp and I am a software engineer from Magdeburg, Germany. In my spare time, I host various free services. Here I write articles about security and privacy.

Read more" - }, - "yourOpinion": { - "de": "Schreib mir deine Meinung", - "en": "Send me your opinion" - } - } -} diff --git a/src/_includes/donations-current.html b/src/_includes/donations-current.html index ec60a4c..5ecb715 100644 --- a/src/_includes/donations-current.html +++ b/src/_includes/donations-current.html @@ -2,17 +2,17 @@ - - - - + + + + {% for donation in donations[0].donations %} - + {% if donation.from %} {% else %} @@ -24,7 +24,7 @@ - + diff --git a/src/_includes/donations.html b/src/_includes/donations.html index 7a373b5..06ea695 100644 --- a/src/_includes/donations.html +++ b/src/_includes/donations.html @@ -5,17 +5,17 @@
{{strings.donations.date[locale]}}{{strings.donations.via[locale]}}{{strings.donations.from[locale]}}{{strings.donations.amount[locale]}}{{strings.donations.date}}{{strings.donations.via}}{{strings.donations.from}}{{strings.donations.amount}}
{{donation.date}}{{strings.donations[donation.via][locale]}}{{strings.donations[donation.via]}}{{donation.from}}
{{strings.donations.total[locale]}}{{strings.donations.total}} {{donations[0].donations | sum | amount}} €
- - - - + + + + {% for donation in year.donations %} - + {% if donation.from %} {% else %} @@ -27,7 +27,7 @@ - + diff --git a/src/_includes/expenses-current.html b/src/_includes/expenses-current.html index 0fef736..033b407 100644 --- a/src/_includes/expenses-current.html +++ b/src/_includes/expenses-current.html @@ -2,12 +2,12 @@
{{strings.donations.date[locale]}}{{strings.donations.via[locale]}}{{strings.donations.from[locale]}}{{strings.donations.amount[locale]}}{{strings.donations.date}}{{strings.donations.via}}{{strings.donations.from}}{{strings.donations.amount}}
{{donation.date}}{{strings.donations[donation.via][locale]}}{{strings.donations[donation.via]}}{{donation.from}}
{{strings.donations.total[locale]}}{{strings.donations.total}} {{year.donations | sum | amount}} €
- - - - - - + + + + + + @@ -28,7 +28,7 @@ - + diff --git a/src/_includes/layouts/article.njk b/src/_includes/layouts/article.njk index 3c33b88..8b4e771 100644 --- a/src/_includes/layouts/article.njk +++ b/src/_includes/layouts/article.njk @@ -16,7 +16,7 @@ layout: base.njk
{% if series %}
-
{{ strings.article.seriesParts[locale] }}
+
{{ strings.article.seriesParts }}
{%- for post in collections.all %} {% if post.data.series == series %} @@ -34,7 +34,7 @@ layout: base.njk {% set service = services | getServiceById(service) %} {% if service %}
-
{{ strings.article.relatedService[locale] }}
+
{{ strings.article.relatedService }}
{% if service.beta == true %} @@ -48,7 +48,7 @@ layout: base.njk {% if service.status %} @@ -59,15 +59,15 @@ layout: base.njk
{% endif %}
-
{{ strings.article.questions[locale] }}
-
{{ strings.article.questionsContent[locale] | safe }}
+
{{ strings.article.questions }}
+
{{ strings.article.questionsContent | safe }}
-
{{ strings.article.aboutMe[locale] }}
-
{{ strings.article.aboutMeContent[locale] | safe }}
+
{{ strings.article.aboutMe }}
+
{{ strings.article.aboutMeContent | safe }}
-
{{ strings.article.yourOpinion[locale] }}
+
{{ strings.article.yourOpinion }}
{{strings.donations.name[locale]}}{{strings.donations.type[locale]}}{{strings.donations.provider[locale]}}{{strings.donations.location[locale]}}{{strings.donations.amount[locale]}} / {{strings.donations.month[locale]}}{{strings.donations.amount[locale]}} / {{strings.donations.year[locale]}}{{strings.donations.name}}{{strings.donations.type}}{{strings.donations.provider}}{{strings.donations.location}}{{strings.donations.amount}} / {{strings.donations.month}}{{strings.donations.amount}} / {{strings.donations.year}}
{{strings.donations.total[locale]}}{{strings.donations.total}} {{expenses | sum | amount}} € {{expenses | sum | year | amount}} €