Compare commits

...

2 commits

Author SHA1 Message Date
Lyn Fugmann 35f5304d8b fix build 2024-10-02 18:26:24 +02:00
Lyn Fugmann db6ed12ba2 add favicon
for some reason it seems to be broken in `npm run start`...
2024-10-02 18:18:54 +02:00
5 changed files with 96 additions and 4 deletions

View file

@ -14,6 +14,7 @@ eleventyComputed:
<script> <script>
{% getBundle "js" %} {% getBundle "js" %}
</script> </script>
{% favicons '_site/ESELogoFavicon.svg' %}
</head> </head>
<body> <body>
{% include 'header.njk' %} {% include 'header.njk' %}

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Gravit.io -->
<svg
style="isolation:isolate"
viewBox="0 0 439.44 439.43999"
width="439.44pt"
height="439.44pt"
version="1.1"
id="svg58"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<g
id="g55"
style="isolation:isolate"
transform="translate(-251.347,-231.6805)">
<path
d="m 378.418,545.365 -127.071,8.843 V 378.99 l 124.535,-8.685 v 27.418 l -89.32,6.212 v 46.213 l 82.949,-5.768 v 27.671 l -82.949,5.768 v 46.214 l 91.856,-6.403 z"
fill="{{ese.color}}"
id="path53" />
<path
d="m 532.051,411.003 -35.976,2.504 c -2.06,-17.623 -12.013,-28.114 -30.365,-26.815 -14.041,0.983 -24.755,8.336 -24.755,22.536 0,14.2 9.446,21.427 37.497,26.087 38.797,6.18 56.135,22.758 56.135,50.936 0,32.996 -30.366,53.915 -65.073,56.324 -42.093,2.916 -69.669,-13.693 -72.965,-50.27 l 35.975,-2.504 c 3.835,19.018 18.637,27.893 36.483,26.656 16.07,-1.109 28.843,-10.65 28.843,-24.089 0,-14.739 -9.192,-22.726 -35.214,-27.005 -35.976,-6.118 -58.702,-16.99 -58.702,-49.257 0,-32.266 29.351,-53.345 63.044,-55.69 42.093,-2.916 61.238,19.62 65.073,50.587 z"
fill="{{ese.color}}"
id="path54" />
<path
d="m 690.787,523.621 -127.071,8.843 V 357.246 l 124.535,-8.653 v 27.417 l -89.321,6.213 v 46.213 l 82.918,-5.768 v 27.671 l -82.918,5.768 v 46.214 l 91.857,-6.403 v 27.671 0 z"
fill="{{ese.color}}"
id="path55" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -1,5 +1,6 @@
const { EleventyHtmlBasePlugin, EleventyI18nPlugin } = require("@11ty/eleventy"); const { EleventyHtmlBasePlugin, EleventyI18nPlugin } = require("@11ty/eleventy");
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation"); const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
const faviconsPlugin = require("eleventy-plugin-gen-favicons");
const bundlerPlugin = require("@11ty/eleventy-plugin-bundle"); const bundlerPlugin = require("@11ty/eleventy-plugin-bundle");
const pluginIcons = require('eleventy-plugin-icons'); const pluginIcons = require('eleventy-plugin-icons');
const Image = require("@11ty/eleventy-img"); const Image = require("@11ty/eleventy-img");
@ -24,6 +25,7 @@ module.exports = function(eleventyConfig) {
shortcode: "rawIcon", shortcode: "rawIcon",
}, },
}); });
eleventyConfig.addPlugin(faviconsPlugin, {});
// override icon shortcode to make the SVGs accessible // override icon shortcode to make the SVGs accessible
eleventyConfig.addAsyncShortcode("icon", async function(input, attrs) { eleventyConfig.addAsyncShortcode("icon", async function(input, attrs) {
@ -81,7 +83,13 @@ module.exports = function(eleventyConfig) {
}); });
await session.replaceAll(); await session.replaceAll();
return session.getSvgString(); let finalSvg = session.getSvgString();
// no idea why this gets mangled
finalSvg = finalSvg.replaceAll("svg:svg", "svg");
finalSvg = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n' + finalSvg;
return finalSvg;
}; };
} }
}); });
@ -130,7 +138,7 @@ module.exports = function(eleventyConfig) {
async ({ dir, runMode, outputMode }) => { async ({ dir, runMode, outputMode }) => {
if (outputMode === "fs") { if (outputMode === "fs") {
fs.copyFile(`${dir.output}/de/index.html`, `${dir.output}/index.html`, (err) => { fs.copyFile(`${dir.output}/de/index.html`, `${dir.output}/index.html`, (err) => {
if (err) console.log(err); if (err && err.code !== 'ENOENT') console.log(err);
}); });
} }
} }

48
package-lock.json generated
View file

@ -14,6 +14,7 @@
"@11ty/eleventy-navigation": "^0.3.5", "@11ty/eleventy-navigation": "^0.3.5",
"@11ty/eleventy-plugin-bundle": "^1.0.5", "@11ty/eleventy-plugin-bundle": "^1.0.5",
"@fortawesome/fontawesome-free": "^6.6.0", "@fortawesome/fontawesome-free": "^6.6.0",
"eleventy-plugin-gen-favicons": "^1.1.3",
"eleventy-plugin-icons": "^4.5.1", "eleventy-plugin-icons": "^4.5.1",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"markdown-it": "^14.1.0", "markdown-it": "^14.1.0",
@ -841,6 +842,13 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": {
"version": "17.0.45",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz",
"integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==",
"dev": true,
"license": "MIT"
},
"node_modules/a-sync-waterfall": { "node_modules/a-sync-waterfall": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz", "resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz",
@ -1623,6 +1631,18 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/eleventy-plugin-gen-favicons": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/eleventy-plugin-gen-favicons/-/eleventy-plugin-gen-favicons-1.1.3.tgz",
"integrity": "sha512-MvE2uDiFNU82b8m8L8hOQRANE2ljjZWglXwqxSG7ECgr5QLUIE8nyGQ2xDLutzXxti2ljVhttwpjU5z4P2SCeg==",
"dev": true,
"license": "MIT",
"dependencies": {
"fast-deep-equal": "^3.1.3",
"png-to-ico": "^2.1.8",
"sharp": "^0.33.4"
}
},
"node_modules/eleventy-plugin-icons": { "node_modules/eleventy-plugin-icons": {
"version": "4.5.1", "version": "4.5.1",
"resolved": "https://registry.npmjs.org/eleventy-plugin-icons/-/eleventy-plugin-icons-4.5.1.tgz", "resolved": "https://registry.npmjs.org/eleventy-plugin-icons/-/eleventy-plugin-icons-4.5.1.tgz",
@ -3353,6 +3373,34 @@
"semver-compare": "^1.0.0" "semver-compare": "^1.0.0"
} }
}, },
"node_modules/png-to-ico": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/png-to-ico/-/png-to-ico-2.1.8.tgz",
"integrity": "sha512-Nf+IIn/cZ/DIZVdGveJp86NG5uNib1ZXMiDd/8x32HCTeKSvgpyg6D/6tUBn1QO/zybzoMK0/mc3QRgAyXdv9w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/node": "^17.0.36",
"minimist": "^1.2.6",
"pngjs": "^6.0.0"
},
"bin": {
"png-to-ico": "bin/cli.js"
},
"engines": {
"node": ">=8"
}
},
"node_modules/pngjs": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz",
"integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12.13.0"
}
},
"node_modules/posthtml": { "node_modules/posthtml": {
"version": "0.16.6", "version": "0.16.6",
"resolved": "https://registry.npmjs.org/posthtml/-/posthtml-0.16.6.tgz", "resolved": "https://registry.npmjs.org/posthtml/-/posthtml-0.16.6.tgz",

View file

@ -4,8 +4,10 @@
"description": "This is the WIP rewrite of the ESE website.", "description": "This is the WIP rewrite of the ESE website.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"build": "npx @11ty/eleventy", "prebuild": "npx @11ty/eleventy --formats=logo.svg",
"start": "npx @11ty/eleventy --serve" "build": "npx @11ty/eleventy --formats=md,njk",
"prestart": "npx @11ty/eleventy --formats=logo.svg",
"start": "npx @11ty/eleventy --serve --formats=md,njk"
}, },
"author": "FSR Informatik TU Dresden", "author": "FSR Informatik TU Dresden",
"license": "MIT", "license": "MIT",
@ -15,6 +17,7 @@
"@11ty/eleventy-navigation": "^0.3.5", "@11ty/eleventy-navigation": "^0.3.5",
"@11ty/eleventy-plugin-bundle": "^1.0.5", "@11ty/eleventy-plugin-bundle": "^1.0.5",
"@fortawesome/fontawesome-free": "^6.6.0", "@fortawesome/fontawesome-free": "^6.6.0",
"eleventy-plugin-gen-favicons": "^1.1.3",
"eleventy-plugin-icons": "^4.5.1", "eleventy-plugin-icons": "^4.5.1",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"markdown-it": "^14.1.0", "markdown-it": "^14.1.0",