From d7889e5ad636946c3b233eaad567010920a8982f Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Sun, 31 May 2026 14:50:19 +0200 Subject: [PATCH] fix: serve halfmoon css through addPassthroughCopy (#799) Serve halfmoon CSS files through eleventry's addPassthroughCopy instead of template file, avoiding serving additional HTML bloat. Network usage wise, this changes from one 423 KiB uncompressed response to two responses 380 KiB total Followup to https://codeberg.org/Codeberg/Documentation/pulls/655 Solves https://codeberg.org/Codeberg/Documentation/pulls/655#issuecomment-7361962 Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/799 Reviewed-by: Gusted --- content/_includes/default_layout.njk | 3 ++- content/halfmoon.njk | 5 ----- eleventy.config.mjs | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 content/halfmoon.njk diff --git a/content/_includes/default_layout.njk b/content/_includes/default_layout.njk index 5711a8b..e250482 100644 --- a/content/_includes/default_layout.njk +++ b/content/_includes/default_layout.njk @@ -20,7 +20,8 @@ - + + diff --git a/content/halfmoon.njk b/content/halfmoon.njk deleted file mode 100644 index b9b4452..0000000 --- a/content/halfmoon.njk +++ /dev/null @@ -1,5 +0,0 @@ ---- -permalink: halfmoon.css ---- -{% include "../node_modules/halfmoon/css/halfmoon.min.css" %} -{% include "../node_modules/halfmoon/css/cores/halfmoon.modern.css" %} diff --git a/eleventy.config.mjs b/eleventy.config.mjs index 694b0db..6b63c9b 100644 --- a/eleventy.config.mjs +++ b/eleventy.config.mjs @@ -23,6 +23,7 @@ export default function (eleventyConfig) { }); eleventyConfig.addPassthroughCopy('assets'); + eleventyConfig.addPassthroughCopy({ 'node_modules/halfmoon/css': '/assets/css/halfmoon' }); eleventyConfig.addPassthroughCopy('fonts'); // Font Awesome Icons