diff --git a/.compress-all.js b/.compress-all.js new file mode 100644 index 0000000..dcbce1e --- /dev/null +++ b/.compress-all.js @@ -0,0 +1,32 @@ +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 2287334..4ca320e 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,28 +1,9 @@ -const pluginRev = require("eleventy-plugin-rev"); -const pluginSass = require("eleventy-sass"); -const pluginTinyHtml = require("@sardine/eleventy-plugin-tinyhtml"); -const pluginNavigation = require("@11ty/eleventy-navigation"); +const eleventyNavigationPlugin = require("@11ty/eleventy-navigation"); module.exports = function (eleventyConfig) { - 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.addWatchTarget("./src/scss/"); + eleventyConfig.addPlugin(eleventyNavigationPlugin); eleventyConfig.setUseGitIgnore(false); eleventyConfig.addPassthroughCopy({ "src/img": "img", @@ -38,7 +19,7 @@ module.exports = function (eleventyConfig) { }); eleventyConfig.addFilter("sum", function (value) { - return value.map(d => d.amount).reduce((a, b) => a + b, 0); + return value.map(d => d.amount).reduce((a, b) => a + b); }); eleventyConfig.addFilter("amount", function (value) { @@ -62,10 +43,6 @@ 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 c405d9c..98fe243 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,12 @@ "version": "1.0.0", "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", - "start": "eleventy --serve --watch", - "build": "eleventy && npm run move-index && npm run minify-css", + "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", "move-index": "cpx dist/de/index.html dist/" }, "author": "samuel-p", @@ -14,7 +17,7 @@ "url": "https://git.sp-codes.de/samuel-p/sp-codes.de" }, "optionalDependencies": { - "browser-sync": "^2.27.11" + "browser-sync": "^2.27.10" }, "devDependencies": { "@11ty/eleventy": "^1.0.2", @@ -22,17 +25,15 @@ "@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", - "postcss": "^8.4.21", - "sass": "^1.57.1", + "node-sass": "^8.0.0", + "node-sass-tilde-importer": "^1.0.2", + "npm-run-all": "^4.1.5", "uncss": "^0.17.3" }, "dependencies": { - "bootstrap": "^5.2.3" + "bootstrap": "^4.6.2" } } diff --git a/src/_data/donations.json b/src/_data/donations.json index 8981452..a5ba3fa 100644 --- a/src/_data/donations.json +++ b/src/_data/donations.json @@ -1,18 +1,7 @@ [ - { - "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 deleted file mode 100644 index f564bc9..0000000 --- a/src/_includes/layouts/article.njk +++ /dev/null @@ -1,101 +0,0 @@ ---- -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 80c54fc..f012dea 100644 --- a/src/_includes/layouts/base.njk +++ b/src/_includes/layouts/base.njk @@ -33,19 +33,19 @@ title: sp-codes - +