diff --git a/.eleventy.js b/.eleventy.js index 0dbdacd..3bd56be 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -9,6 +9,15 @@ module.exports = function(eleventyConfig) { eleventyConfig.addPassthroughCopy("fonts") eleventyConfig.addShortcode("fas_icon", function(name) { return `` }) + + // List of icons: https://codeberg.org/Codeberg/gitea/src/branch/codeberg/public/img/svg + eleventyConfig.addShortcode("gitea_icon", function(name) { + const fetch = require('node-fetch'); + fetch(`https://codeberg.org/img/svg/${name}.svg`) + .then(res => res.text()) + .then(body => {return svg = body;}); + return svg + }) return { dir: { diff --git a/package-lock.json b/package-lock.json index 9f785c5..41db5c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,8 @@ "devDependencies": { "@11ty/eleventy": "^0.12.1", "@11ty/eleventy-navigation": "^0.1.6", - "@11ty/eleventy-plugin-syntaxhighlight": "^3.0.1" + "@11ty/eleventy-plugin-syntaxhighlight": "^3.0.1", + "node-fetch": "^2.6.1" } }, "node_modules/@11ty/dependency-tree": { @@ -2246,6 +2247,15 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "node_modules/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "dev": true, + "engines": { + "node": "4.x || >=6.0.0" + } + }, "node_modules/nopt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", @@ -5644,6 +5654,12 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "dev": true + }, "nopt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", diff --git a/package.json b/package.json index 19687a8..8b9d643 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "devDependencies": { "@11ty/eleventy": "^0.12.1", "@11ty/eleventy-navigation": "^0.1.6", - "@11ty/eleventy-plugin-syntaxhighlight": "^3.0.1" + "@11ty/eleventy-plugin-syntaxhighlight": "^3.0.1", + "node-fetch": "^2.6.1" } }