add syntax highlighting

This commit is contained in:
nova ember madeline 2025-05-01 13:24:31 +02:00
parent 153595ba29
commit ccec849b21
4 changed files with 33 additions and 1 deletions

View file

@ -1,4 +1,6 @@
module.exports = function(eleventyConfig) { module.exports = function(eleventyConfig) {
// Define global variables
const config = { const config = {
"config" : { "config" : {
// "base_url": "kittygirl.online", // "base_url": "kittygirl.online",
@ -14,7 +16,11 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addGlobalData(item, config[item]); eleventyConfig.addGlobalData(item, config[item]);
} }
// Code Syntax Highlighting Plugin
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
eleventyConfig.addPlugin(syntaxHighlight);
// Nice Date / Time Display
var nunjucksDate = require("nunjucks-date"); var nunjucksDate = require("nunjucks-date");
// http://momentjs.com/docs/#/displaying/format/ // http://momentjs.com/docs/#/displaying/format/
nunjucksDate.setDefaultFormat("DD.MM.YYYY"); nunjucksDate.setDefaultFormat("DD.MM.YYYY");

23
package-lock.json generated
View file

@ -9,6 +9,7 @@
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"nunjucks-date": "^1.5.0" "nunjucks-date": "^1.5.0"
}, },
"devDependencies": { "devDependencies": {
@ -173,6 +174,19 @@
"url": "https://opencollective.com/11ty" "url": "https://opencollective.com/11ty"
} }
}, },
"node_modules/@11ty/eleventy-plugin-syntaxhighlight": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-plugin-syntaxhighlight/-/eleventy-plugin-syntaxhighlight-5.0.0.tgz",
"integrity": "sha512-y9BUmP1GofmbJgxM1+ky/UpFCpD8JSOeLeKItUs0WApgnrHk9haHziW7lS86lbArX5SiCVo4zTTw9x53gvRCaA==",
"license": "MIT",
"dependencies": {
"prismjs": "^1.29.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/11ty"
}
},
"node_modules/@11ty/eleventy-utils": { "node_modules/@11ty/eleventy-utils": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-utils/-/eleventy-utils-1.0.3.tgz", "resolved": "https://registry.npmjs.org/@11ty/eleventy-utils/-/eleventy-utils-1.0.3.tgz",
@ -1828,6 +1842,15 @@
"node": ">=12" "node": ">=12"
} }
}, },
"node_modules/prismjs": {
"version": "1.30.0",
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz",
"integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/promise": { "node_modules/promise": {
"version": "7.3.1", "version": "7.3.1",
"resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",

View file

@ -17,6 +17,7 @@
"@11ty/eleventy": "^3.0.0" "@11ty/eleventy": "^3.0.0"
}, },
"dependencies": { "dependencies": {
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"nunjucks-date": "^1.5.0" "nunjucks-date": "^1.5.0"
} }
} }

View file

@ -1,3 +1,5 @@
@import url(./light.css); @import url(./light.css);
@import url(./dark.css); @import url(./dark.css);
@import url(./darkmode-toggle.css); @import url(./darkmode-toggle.css);
@import url(./prismjs-themes/prism-one-dark.css);