diff --git a/.eleventy.js b/.eleventy.js index 2287334..d8e63bb 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -62,8 +62,15 @@ module.exports = function (eleventyConfig) { .length; }); - eleventyConfig.addFilter('getServiceById', (services, serviceId) => { - return services.find(s => s.id === serviceId); + eleventyConfig.addCollection("series", function (collectionApi) { + return collectionApi.getAll() + .filter(p => p.data?.series) + .sort((p0, p1) => p0.data.order - p1.data.order) + .reduce((series, post) => { + series[post.data.series] = series[post.data.series] ?? []; + series[post.data.series].push(post); + return series; + }, {}); }); return { diff --git a/.forgejo/workflows/build-deploy.yml b/.forgejo/workflows/build-deploy.yml index b153732..2d70ed3 100644 --- a/.forgejo/workflows/build-deploy.yml +++ b/.forgejo/workflows/build-deploy.yml @@ -3,13 +3,30 @@ name: Build and Deploy Website on: [push] jobs: + build-dev: + name: Build Dev Website + runs-on: docker + container: + image: node:lts + if: github.ref != 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: npm install + - name: Build Website + run: npm run build:dev + - uses: actions/upload-artifact@v3 + with: + name: build + path: dist/ build: name: Build Website runs-on: docker container: image: node:lts + if: github.ref == 'refs/heads/main' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Dependencies run: npm install - name: Build Website @@ -23,7 +40,7 @@ jobs: runs-on: docker container: image: node:lts-alpine - needs: [build] + needs: [build-dev] if: github.ref == 'refs/heads/develop' steps: - uses: actions/download-artifact@v3 diff --git a/README.md b/README.md index 8e9e175..f6704d0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # sp-codes.de -[![Build Status](https://ci.sp-codes.de/api/badges/samuel-p/sp-codes.de/status.svg?branch=main)](https://ci.sp-codes.de/samuel-p/sp-codes.de) - Website for [sp-codes.de](https://sp-codes.de) ## Additional Header Parameters @@ -9,7 +7,7 @@ Website for [sp-codes.de](https://sp-codes.de) The following Parameters are set directly on the Web-Server. ``` -Content-Security-Policy: default-src 'none'; script-src 'self' https://umami.sp-codes.de; object-src 'none'; style-src 'self'; img-src 'self' https://shields.sp-codes.de; media-src 'none'; frame-src 'none'; font-src 'self'; connect-src 'self' https://umami.sp-codes.de +Content-Security-Policy: default-src 'none'; script-src 'self' https://umami.sp-codes.de; object-src 'none'; style-src 'self'; img-src 'self' https://status.sp-codes.de https://shields.sp-codes.de; media-src 'none'; frame-src 'none'; font-src 'self'; connect-src 'self' https://umami.sp-codes.de Referrer-Policy: strict-origin-when-cross-origin Feature-Policy: sync-xhr 'self' Strict-Transport-Security: max-age=31536000; includeSubDomains; preload diff --git a/package.json b/package.json index 0b9272e..3b85be3 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,10 @@ "description": "website for sp-codes.de", "scripts": { "minify-css": "uncss -n -H dist/ -o dist/css/main-*.css dist/**/*.html dist/**/**/*.html dist/**/**/**/*.html dist/**/**/**/**/*.html dist/**/**/**/**/**/*.html", + "add-index": "cpx dist/de/index.html dist/ && replace-in-file sp-codes.de/de/ sp-codes.de/ dist/index.html", "start": "eleventy --serve --watch", - "build": "eleventy && npm run move-index && npm run minify-css", - "move-index": "cpx dist/de/index.html dist/" + "build": "eleventy && npm run minify-css && npm run add-index", + "build:dev": "BUILD=dev eleventy && npm run minify-css && npm run add-index" }, "author": "samuel-p", "repository": { @@ -14,7 +15,7 @@ "url": "https://git.sp-codes.de/samuel-p/sp-codes.de" }, "optionalDependencies": { - "browser-sync": "^2.29.3" + "browser-sync": "^3.0.2" }, "devDependencies": { "@11ty/eleventy": "^2.0.1", @@ -26,13 +27,14 @@ "cpx": "^1.5.0", "eleventy-plugin-rev": "^2.0.0", "eleventy-sass": "^2.2.4", - "glob": "^10.3.10", - "minify": "^10.5.2", - "postcss": "^8.4.32", - "sass": "^1.69.5", + "glob": "^10.3.12", + "minify": "^11.1.1", + "postcss": "^8.4.38", + "replace-in-file": "^7.1.0", + "sass": "^1.72.0", "uncss": "^0.17.3" }, "dependencies": { - "bootstrap": "^5.3.2" + "bootstrap": "^5.3.3" } } diff --git a/src/_data/donations.json b/src/_data/donations.json index e444c82..658e353 100644 --- a/src/_data/donations.json +++ b/src/_data/donations.json @@ -2,12 +2,19 @@ { "year": 2024, "donations": [ + { + "date": "26.02.2024", + "amount": 20, + "via": "banktransfer", + "from": "ub1x", + "first": false + }, { "date": "23.01.2024", "amount": 25, "via": "banktransfer", "from": null, - "first": false + "first": true } ] }, @@ -35,13 +42,6 @@ "from": "ub1x", "first": false }, - { - "date": "26.10.2023", - "amount": 20, - "via": "banktransfer", - "from": "ub1x", - "first": false - }, { "date": "17.07.2023", "amount": 20, diff --git a/src/_data/eleventyComputed.js b/src/_data/eleventyComputed.js new file mode 100644 index 0000000..00295a2 --- /dev/null +++ b/src/_data/eleventyComputed.js @@ -0,0 +1,5 @@ +module.exports = { + service: (data) => data.services.find(s => s.id === data.service), + title: (data) => data.title || data.service?.name || "", + summary: (data) => data.summary || data.service?.summary?.[data.locale] || "" +} diff --git a/src/_data/global.dev.json b/src/_data/global.dev.json new file mode 100644 index 0000000..fd531ee --- /dev/null +++ b/src/_data/global.dev.json @@ -0,0 +1,4 @@ +{ + "title": "DEV sp-codes", + "url": "https://dev.sp-codes.de" +} diff --git a/src/_data/global.json b/src/_data/global.json new file mode 100644 index 0000000..878c0d0 --- /dev/null +++ b/src/_data/global.json @@ -0,0 +1,18 @@ +{ + "title": "sp-codes", + "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/services.json b/src/_data/services.json index 3c8ce56..4f58d6e 100644 --- a/src/_data/services.json +++ b/src/_data/services.json @@ -8,7 +8,38 @@ "summary": { "de": "Die offene Plattform für sichere und dezentrale Kommunikation.", "en": "The open platform for secure and decentralized communication." - } + }, + "cards": [ + { + "title": { + "de": "Mein Angebot", + "en": "My Offer" + }, + "content": { + "de": "

Seit Anfang 2020 betreibe ich einen öffentlichen Matrix-Server: matrix.sp-codes.de und eine öffentliche Element-Web Instanz: chat.sp-codes.de

Jetzt registrieren
", + "en": "

Since the beginning of 2020 I run a public Matrix server: matrix.sp-codes.de and a public Element-Web instance: chat.sp-codes.de

Register now
" + } + }, + { + "title": { + "de": "Einstieg", + "en": "Getting started" + }, + "content": { + "de": "

Hier findest du eine Artikelserie für einen einfachen Einstieg in Matrix:

  1. Werde Teil der Matrix
  2. Sichere Chats mit Matrix
", + "en": "

Here you will find an article series (German) for an easy start to Matrix:

  1. Werde Teil der Matrix
  2. Sichere Chats mit Matrix
" + } + }, + { + "ossrox": { + "url": "https://ossrox.org/store/matrix" + }, + "content": { + "de": "Wenn du einen eigenen Matrix-Server für dich, deine Familie oder deine Firma betreiben willst, unterstütze ich dich gerne mit meiner Firma Ossrox damit. Schau dir gerne unser Angebot dazu auf unserer Webseite an oder schreib mir eine Nachricht dazu.", + "en": "If you want to have your own Matrix server for you, your family or your company, I would be happy to support you with my company Ossrox. Please have a look at our services on our website or send me a message." + } + } + ] }, { "id": "jitsi", @@ -17,9 +48,30 @@ "url": "https://jitsi.sp-codes.de", "status": "2", "summary": { - "de": "Einfache Videokonferenzen mit Leichtigkeit.", - "en": "Easy video conferencing with ease." - } + "de": "Einfache und sichere Videokonferenzen.", + "en": "Easy and secure video conferencing." + }, + "cards": [ + { + "title": { + "de": "Mein Angebot", + "en": "My Offer" + }, + "content": { + "de": "

Seit Juli 2020 betreibe ich eine eigene Jitsi-Meet Instanz. Du findest sie unter jitsi.sp-codes.de.

Meeting starten
", + "en": "

Since July 2020 I run my own Jitsi-Meet instance. You can find it at jitsi.sp-codes.de.

Start meeting
" + } + }, + { + "ossrox": { + "url": "https://ossrox.org/store/jitsi" + }, + "content": { + "de": "Wenn du einen eigenen Jitsi-Server für dich, deine Familie oder deine Firma betreiben willst, unterstütze ich dich gerne mit meiner Firma Ossrox damit. Schau dir gerne unser Angebot dazu auf unserer Webseite an oder schreib mir eine Nachricht dazu.", + "en": "If you want to have your own Jitsi server for you, your family or your company, I would be happy to support you with my company Ossrox. Please have a look at our services on our website or send me a message." + } + } + ] }, { "id": "mastodon", @@ -30,7 +82,28 @@ "summary": { "de": "Das soziale Netzwerk für dezentrale und sichere Interaktion.", "en": "The social network for decentralized and secure interaction." - } + }, + "cards": [ + { + "title": { + "de": "Mein Angebot", + "en": "My Offer" + }, + "content": { + "de": "

Seit Mai 2021 betreibe ich eine öffentliche Mastodon-Instanz: social.sp-codes.de

Jetzt registrieren
", + "en": "

Since May 2021 I run a public Mastodon instance: social.sp-codes.de

Register now
" + } + }, + { + "ossrox": { + "url": "https://ossrox.org/store/mastodon" + }, + "content": { + "de": "Wenn du einen eigenen Mastodon-Server für dich, deine Familie oder deine Firma betreiben willst, unterstütze ich dich gerne mit meiner Firma Ossrox damit. Schau dir gerne unser Angebot dazu auf unserer Webseite an oder schreib mir eine Nachricht dazu.", + "en": "If you want to have your own mastodon server for you, your family or your company, I would be happy to support you with my company Ossrox. Please have a look at our services on our website or send me a message." + } + } + ] }, { "id": "peertube", @@ -41,7 +114,28 @@ "summary": { "de": "Die freie und dezentrale Plattform für gemeinsames Video-Streaming.", "en": "The free and decentralized platform for collaborative video streaming." - } + }, + "cards": [ + { + "title": { + "de": "Mein Angebot", + "en": "My Offer" + }, + "content": { + "de": "

Seit August 2021 betreibe ich eine öffentliche PeerTube-Instanz: tube.sp-codes.de

Jetzt registrieren
", + "en": "

Since August 2021 I run a public PeerTube instance: tube.sp-codes.de

Register now
" + } + }, + { + "ossrox": { + "url": "https://ossrox.org/store" + }, + "content": { + "de": "Wenn du einen eigenen PeerTube-Server betreiben willst, um deine Plattform für Videos und Live-Streams zu starten, unterstütze ich dich gerne mit meiner Firma Ossrox damit. Schau dir gerne unser Angebot dazu auf unserer Webseite an oder schreib mir eine Nachricht dazu.", + "en": "If you want to run your own PeerTube server to start your platform for videos and live streams, I would be happy to support you with my company Ossrox. Take a look at our offer on our website or write me a message." + } + } + ] }, { "id": "pixelfed", @@ -64,7 +158,28 @@ "summary": { "de": "Die Plattform für einfaches und sicheres Code-Hosting.", "en": "The platform for easy and secure code hosting." - } + }, + "cards": [ + { + "title": { + "de": "Mein Angebot", + "en": "My Offer" + }, + "content": { + "de": "

Seit Ende 2019 betreibe ich eine eigene Forgejo Instanz, in der ich meine Projekte verwalte. Hier geht's lang: git.sp-codes.de

Jetzt registrieren
", + "en": "

Since the end of 2019, I have been running my own Forgejo instance where I manage my projects. This way: git.sp-codes.de

Register now
" + } + }, + { + "ossrox": { + "url": "https://ossrox.org/store" + }, + "content": { + "de": "Wenn du deine Projekte in einer eigenen Forgejo-, Gitea- oder GitLab-Instanz verwalten willst, unterstütze ich dich gerne mit meiner Firma Ossrox damit. Schau dir gerne unser Angebot dazu auf unserer Webseite an oder schreib mir eine Nachricht dazu.", + "en": "If you want to manage your projects in your own Forgejo, Gitea or GitLab instance, I will be happy to support you with my company Ossrox. Take a look at our offer on our website or write me a message." + } + } + ] }, { "id": "connectivitycheck", @@ -74,7 +189,29 @@ "summary": { "de": "Überprüfung der Verfügbarkeit von Internetzugang.", "en": "Verification of Internet access availability." - } + }, + "cards": [ + { + "title": { + "de": "Mein Angebot", + "en": "My Offer" + }, + "content": { + "de": "

Seit Mitte 2019 stelle ich einen freien Captive Portal Check zur Verfügung: https://connectivitycheck.sp-codes.de/generate204

", + "en": "

Since mid 2019 I provide a free Captive Portal Check: https://connectivitycheck.sp-codes.de/generate204

" + } + }, + { + "title": { + "de": "Einrichtung", + "en": "Setup" + }, + "content": { + "de": "

Hier findest du einen Artikel, der dir die Einrichtung auf verschiedenen Geräten erklärt:

", + "en": "

Here you will find an article that explains how to set it up on various devices:

" + } + } + ] }, { "id": "ntfy", @@ -85,7 +222,19 @@ "summary": { "de": "Echtzeitbenachrichtigungen mit UnifiedPush-Unterstützung.", "en": "Real-time notifications with UnifiedPush support." - } + }, + "cards": [ + { + "title": { + "de": "Mein Angebot", + "en": "My Offer" + }, + "content": { + "de": "

Seit Mai 2023 stelle ich ntfy zur freien Verfügung: ntfy.sp-codes.de

Gerne kannst du ntfy als Push-Provider für deine Apps nutzen, wenn du möchtest.
", + "en": "

Since May 2023 I provide ntfy for free: https://ntfy.sp-codes.de You are welcome to use ntfy as push provider for your apps if you like.

" + } + } + ] }, { "id": "etherpad", @@ -96,7 +245,19 @@ "summary": { "de": "Gemeinsame Echtzeit-Textbearbeitung für effektive Zusammenarbeit.", "en": "Collaborative real-time text editing for effective collaboration." - } + }, + "cards": [ + { + "title": { + "de": "Mein Angebot", + "en": "My Offer" + }, + "content": { + "de": "

Seit Ende 2020 betreibe ich Etherpad: pad.sp-codes.de

Dokument öffnen
", + "en": "

I've been running Etherpad since the end of 2020: pad.sp-codes.de

Open document
" + } + } + ] }, { "id": "shields", @@ -107,6 +268,18 @@ "summary": { "de": "Visuelle Badges zur Anzeige von Projektinformationen und Status.", "en": "Visual badges for displaying project information and status." - } + }, + "cards": [ + { + "title": { + "de": "Mein Angebot", + "en": "My Offer" + }, + "content": { + "de": "

Seit August 2020 betreibe ich eine öffentliche Shields Instanz. Schau gerne mal rein: shields.sp-codes.de

", + "en": "

Since August 2020 I have been running a public Shields instance. Feel free to take a look: shields.sp-codes.de

" + } + } + ] } ] diff --git a/src/_data/site.js b/src/_data/site.js index dff3c06..9f67ce6 100644 --- a/src/_data/site.js +++ b/src/_data/site.js @@ -1,21 +1,10 @@ -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 fs = require("fs"); +const site = require("./global.json"); +site.buildName = process.env.BUILD || 'prod'; +if (fs.existsSync(`${__dirname}/global.${site.buildName}.json`)) { + Object.assign(site, require(`./global.${site.buildName}.json`)); +} +site.buildTime = new Date().toISOString(); + +module.exports = site; diff --git a/src/_data/strings.json b/src/_data/strings.json deleted file mode 100644 index 2fe4cff..0000000 --- a/src/_data/strings.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "menu": { - "de": "Menü", - "en": "Menu" - }, - "imprint": { - "de": "Impressum", - "en": "Imprint" - }, - "privacy": { - "de": "Datenschutz", - "en": "Privacy" - }, - "code": { - "de": "Code", - "en": "Code" - }, - "stats": { - "de": "Statistiken", - "en": "Stats" - }, - "supporters": { - "de": "Unterstützer:innen", - "en": "Supporters" - }, - "state": { - "de": "Status", - "en": "State" - }, - "operational": { - "de": "Online", - "en": "Online" - }, - "outage": { - "de": "Ausfall", - "en": "Outage" - }, - "maintenance": { - "de": "Wartung", - "en": "Maintenance" - }, - "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" - }, - "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" - } -} diff --git a/src/_includes/donations-current.html b/src/_includes/donations-current.html index 16e3174..5ecb715 100644 --- a/src/_includes/donations-current.html +++ b/src/_includes/donations-current.html @@ -2,21 +2,17 @@ - - - - + + + + {% for donation in donations[0].donations %} - {% if donation.via == 'opencollective' %} - - {% else %} - - {% endif %} + {% if donation.from %} {% else %} @@ -28,7 +24,7 @@ - + diff --git a/src/_includes/donations.html b/src/_includes/donations.html index 1d3d07c..06ea695 100644 --- a/src/_includes/donations.html +++ b/src/_includes/donations.html @@ -5,21 +5,17 @@
{{strings.date[locale]}}{{strings.via[locale]}}{{strings.from[locale]}}{{strings.amount[locale]}}{{strings.donations.date}}{{strings.donations.via}}{{strings.donations.from}}{{strings.donations.amount}}
{{donation.date}}Open Collective{{strings[donation.via][locale]}}{{strings.donations[donation.via]}}{{donation.from}}
{{strings.total[locale]}}{{strings.donations.total}} {{donations[0].donations | sum | amount}} €
- - - - + + + + {% for donation in year.donations %} - {% if donation.via == 'opencollective' %} - - {% else %} - - {% endif %} + {% if donation.from %} {% else %} @@ -31,7 +27,7 @@ - + diff --git a/src/_includes/expenses-current.html b/src/_includes/expenses-current.html index 8e20df0..033b407 100644 --- a/src/_includes/expenses-current.html +++ b/src/_includes/expenses-current.html @@ -2,12 +2,12 @@
{{strings.date[locale]}}{{strings.via[locale]}}{{strings.from[locale]}}{{strings.amount[locale]}}{{strings.donations.date}}{{strings.donations.via}}{{strings.donations.from}}{{strings.donations.amount}}
{{donation.date}}Open Collective{{strings[donation.via][locale]}}{{strings.donations[donation.via]}}{{donation.from}}
{{strings.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 f564bc9..f96629e 100644 --- a/src/_includes/layouts/article.njk +++ b/src/_includes/layouts/article.njk @@ -16,25 +16,22 @@ layout: base.njk
{% if series %}
-
Alle Teile dieser Serie
+
{{ strings.article.seriesParts }}
- {%- for post in collections.all %} - {% if post.data.series == series %} + {%- for post in collections.series[series] %} - {% endif %} {%- endfor %}
{% endif %} - {% set service = services | getServiceById(service) %} {% if service %}
-
Zugehöriger Dienst
+
{{ strings.article.relatedService }}
{% if service.beta == true %} @@ -48,8 +45,8 @@ layout: base.njk {% if service.status %} {% endif %} @@ -59,34 +56,22 @@ layout: base.njk
{% endif %}
-
Du hast eine Frage dazu?
-
-

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

- #sp-codes:matrix.sp-codes.de -
+
{{ strings.article.questions }}
+
{{ strings.article.questionsContent | safe }}
-
Über mich
-
-

- 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 -
+
{{ strings.article.aboutMe }}
+
{{ strings.article.aboutMeContent | safe }}
-
Schreib mir deine Meinung
+
{{ strings.article.yourOpinion }}
{{strings.name[locale]}}{{strings.type[locale]}}{{strings.provider[locale]}}{{strings.location[locale]}}{{strings.amount[locale]}} / {{strings.month[locale]}}{{strings.amount[locale]}} / {{strings.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.total[locale]}}{{strings.donations.total}} {{expenses | sum | amount}} € {{expenses | sum | year | amount}} €