From ccec849b2126bda6cb6f6f73f5db2afb164b4917 Mon Sep 17 00:00:00 2001 From: nova ember madeline Date: Thu, 1 May 2025 13:24:31 +0200 Subject: [PATCH] add syntax highlighting --- .eleventy.js | 6 ++++++ package-lock.json | 23 +++++++++++++++++++++++ package.json | 3 ++- src/css/main.css | 2 ++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.eleventy.js b/.eleventy.js index 1e9bf49..6c0d21c 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,4 +1,6 @@ + module.exports = function(eleventyConfig) { + // Define global variables const config = { "config" : { // "base_url": "kittygirl.online", @@ -14,7 +16,11 @@ module.exports = function(eleventyConfig) { 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"); // http://momentjs.com/docs/#/displaying/format/ nunjucksDate.setDefaultFormat("DD.MM.YYYY"); diff --git a/package-lock.json b/package-lock.json index d058ade..dff835f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0", "nunjucks-date": "^1.5.0" }, "devDependencies": { @@ -173,6 +174,19 @@ "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": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@11ty/eleventy-utils/-/eleventy-utils-1.0.3.tgz", @@ -1828,6 +1842,15 @@ "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": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", diff --git a/package.json b/package.json index 05e3205..9a9e0c2 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@11ty/eleventy": "^3.0.0" }, "dependencies": { + "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0", "nunjucks-date": "^1.5.0" } -} \ No newline at end of file +} diff --git a/src/css/main.css b/src/css/main.css index e17afa4..3e6817e 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -1,3 +1,5 @@ @import url(./light.css); @import url(./dark.css); @import url(./darkmode-toggle.css); + +@import url(./prismjs-themes/prism-one-dark.css); \ No newline at end of file