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..2287334 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,9 +1,28 @@ -const eleventyNavigationPlugin = require("@11ty/eleventy-navigation"); +const pluginRev = require("eleventy-plugin-rev"); +const pluginSass = require("eleventy-sass"); +const pluginTinyHtml = require("@sardine/eleventy-plugin-tinyhtml"); +const pluginNavigation = require("@11ty/eleventy-navigation"); module.exports = function (eleventyConfig) { - eleventyConfig.addWatchTarget("./src/scss/"); + eleventyConfig.addPlugin(pluginRev); + eleventyConfig.addPlugin(pluginTinyHtml); + eleventyConfig.addPlugin(pluginSass, { + 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(pluginNavigation); - 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..c405d9c 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 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", @@ -17,7 +14,7 @@ "url": "https://git.sp-codes.de/samuel-p/sp-codes.de" }, "optionalDependencies": { - "browser-sync": "^2.27.10" + "browser-sync": "^2.27.11" }, "devDependencies": { "@11ty/eleventy": "^1.0.2", @@ -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..f564bc9 --- /dev/null +++ b/src/_includes/layouts/article.njk @@ -0,0 +1,101 @@ +--- +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 %} +
+
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 +
+
+
+
Ü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 - +