From 29f93a9e6fc984605199030cf9b2be6c9b27bf3b Mon Sep 17 00:00:00 2001 From: samuel Date: Thu, 12 Jan 2023 22:33:15 +0100 Subject: [PATCH] added articles other improvements --- .compress-all.js | 32 --------- .eleventy.js | 29 +++++++- package.json | 19 +++-- src/_data/donations.json | 11 +++ src/_includes/layouts/article.njk | 92 +++++++++++++++++++++++++ src/_includes/layouts/base.njk | 26 +++---- src/_includes/layouts/services.njk | 2 +- src/_includes/profiles.html | 4 ++ src/de/about.md | 11 +++ src/de/articles.html | 35 ++++++++++ src/de/blog.md | 11 --- src/de/services/matrix.md | 6 +- src/de/services/matrix/setup/part-1.md | 80 +++++++++++++++++++++ src/de/services/matrix/setup/part-2.md | 54 +++++++++++++++ src/de/services/searx.md | 2 +- src/de/services/searx/setup.md | 56 +++++++++++++++ src/en/about.md | 11 +++ src/en/blog.md | 11 --- src/en/services/matrix.md | 4 +- src/img/searx/setup/chrome-1.png | Bin 0 -> 20890 bytes src/img/searx/setup/firefox-1.png | Bin 0 -> 13301 bytes src/img/searx/setup/firefox-2.png | Bin 0 -> 27409 bytes src/scss/main.scss | 55 ++++++++++----- 23 files changed, 448 insertions(+), 103 deletions(-) delete mode 100644 .compress-all.js create mode 100644 src/_includes/layouts/article.njk create mode 100644 src/de/about.md create mode 100644 src/de/articles.html delete mode 100644 src/de/blog.md create mode 100644 src/de/services/matrix/setup/part-1.md create mode 100644 src/de/services/matrix/setup/part-2.md create mode 100644 src/de/services/searx/setup.md create mode 100644 src/en/about.md delete mode 100644 src/en/blog.md create mode 100644 src/img/searx/setup/chrome-1.png create mode 100644 src/img/searx/setup/firefox-1.png create mode 100644 src/img/searx/setup/firefox-2.png diff --git a/.compress-all.js b/.compress-all.js deleted file mode 100644 index dcbce1e..0000000 --- a/.compress-all.js +++ /dev/null @@ -1,32 +0,0 @@ -const glob = require("glob"); -const minify = require('@node-minify/core'); -const htmlMinifier = require('@node-minify/html-minifier'); -const crass = require('@node-minify/crass'); - -console.log('compress all html and css files'); - -glob("dist/**/*.html", function (er, files) { - files.forEach(file => { - console.log(file); - minify({ - compressor: htmlMinifier, - input: file, - output: file, - options: { - collapseWhitespace: true, - conservativeCollapse: true - }, - }); - }) -}); - -glob("dist/**/*.css", function (er, files) { - files.forEach(file => { - console.log(file); - minify({ - compressor: crass, - input: file, - output: file - }); - }) -}); diff --git a/.eleventy.js b/.eleventy.js index 4ca320e..6d93d7b 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,9 +1,28 @@ +const pluginRev = require("eleventy-plugin-rev"); +const eleventySass = require("eleventy-sass"); +const tinyHTML = require('@sardine/eleventy-plugin-tinyhtml'); const eleventyNavigationPlugin = require("@11ty/eleventy-navigation"); module.exports = function (eleventyConfig) { - eleventyConfig.addWatchTarget("./src/scss/"); - + eleventyConfig.addPlugin(pluginRev); + eleventyConfig.addPlugin(tinyHTML); + eleventyConfig.addPlugin(eleventySass, { + sass: { + loadPaths: ["node_modules"], + style: "compressed", + sourceMap: false, + }, + compileOptions: { + permalink: function (contents, inputPath) { + return (data) => { + return data.page.filePathStem.replace(/^\/scss\//, "/css/") + ".css"; + }; + } + }, + rev: true + }); eleventyConfig.addPlugin(eleventyNavigationPlugin); + eleventyConfig.setUseGitIgnore(false); eleventyConfig.addPassthroughCopy({ "src/img": "img", @@ -19,7 +38,7 @@ module.exports = function (eleventyConfig) { }); eleventyConfig.addFilter("sum", function (value) { - return value.map(d => d.amount).reduce((a, b) => a + b); + return value.map(d => d.amount).reduce((a, b) => a + b, 0); }); eleventyConfig.addFilter("amount", function (value) { @@ -43,6 +62,10 @@ module.exports = function (eleventyConfig) { .length; }); + eleventyConfig.addFilter('getServiceById', (services, serviceId) => { + return services.find(s => s.id === serviceId); + }); + return { // Pre-process *.md files with: (default: `liquid`) markdownTemplateEngine: "njk", diff --git a/package.json b/package.json index 98fe243..b08a1e1 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,9 @@ "version": "1.0.0", "description": "website for sp-codes.de", "scripts": { - "compile-sass": "node-sass --output-style compressed --importer=node_modules/node-sass-tilde-importer src/scss/main.scss -o dist/css/", - "minify-css": "uncss -n -H dist/ -o dist/css/main.css dist/**/*.html dist/**/**/*.html dist/**/**/**/*.html", - "watch:eleventy": "eleventy --serve", - "watch:sass": "npm-run-all compile-sass minify-css -- --watch", - "start": "npm-run-all compile-sass minify-css --parallel watch:*", - "build": "npm run compile-sass && eleventy && npm run move-index && npm run minify-css && node .compress-all.js", + "minify-css": "uncss -n -H dist/ -o dist/css/main-*.css dist/**/*.html dist/**/**/*.html dist/**/**/**/*.html", + "start": "eleventy --serve --watch", + "build": "eleventy && npm run move-index && npm run minify-css", "move-index": "cpx dist/de/index.html dist/" }, "author": "samuel-p", @@ -25,15 +22,17 @@ "@node-minify/core": "^7.1.0", "@node-minify/crass": "^7.1.0", "@node-minify/html-minifier": "^7.1.0", + "@sardine/eleventy-plugin-tinyhtml": "^0.2.0", "cpx": "^1.5.0", + "eleventy-plugin-rev": "^1.0.2", + "eleventy-sass": "^2.1.6", "glob": "^8.0.3", "minify": "^9.1.0", - "node-sass": "^8.0.0", - "node-sass-tilde-importer": "^1.0.2", - "npm-run-all": "^4.1.5", + "postcss": "^8.4.21", + "sass": "^1.57.1", "uncss": "^0.17.3" }, "dependencies": { - "bootstrap": "^4.6.2" + "bootstrap": "^5.2.3" } } diff --git a/src/_data/donations.json b/src/_data/donations.json index a5ba3fa..8981452 100644 --- a/src/_data/donations.json +++ b/src/_data/donations.json @@ -1,7 +1,18 @@ [ + { + "year": 2023, + "donations": [] + }, { "year": 2022, "donations": [ + { + "date": "15.12.2022", + "amount": 20, + "via": "banktransfer", + "from": "ub1x", + "first": false + }, { "date": "16.11.2021", "amount": 25, diff --git a/src/_includes/layouts/article.njk b/src/_includes/layouts/article.njk new file mode 100644 index 0000000..13ec8ce --- /dev/null +++ b/src/_includes/layouts/article.njk @@ -0,0 +1,92 @@ +--- +layout: base.njk +--- + +
+
+ {% if tags %} +
+ {% for tag in tags %} + {{tag}} + {% endfor %} +
+ {% endif %} + {{ content | safe }} +
+
+ {% if series %} +
+
Alle Teile dieser Serie
+
+ {%- for post in collections.all %} + {% if post.data.series == series %} + + {% endif %} + {%- endfor %} +
+
+ {% endif %} + {% set service = services | getServiceById(service) %} + {% if service %} +
+
Zugehöriger Dienst
+
+ + {% if service.beta == true %} +
TEST-PHASE
+ {% endif %} +
+ +

{{service.name}}{% if service.url %} {% endif %}

+ {% if service.status %} +
+ + {{strings.state[locale]}} + +
+ {% endif %} +
{{service.summary[locale]}}
+
+
+
+ {% endif %} +
+
Ü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 +
+
+
+
Schreib mir deine Meinung
+ +
+
+
diff --git a/src/_includes/layouts/base.njk b/src/_includes/layouts/base.njk index f012dea..80c54fc 100644 --- a/src/_includes/layouts/base.njk +++ b/src/_includes/layouts/base.njk @@ -33,19 +33,19 @@ title: sp-codes - +