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 <gusted@noreply.codeberg.org>
This commit is contained in:
0ko 2026-05-31 14:50:19 +02:00 committed by Gusted
parent e0fe2eaa66
commit d7889e5ad6
3 changed files with 3 additions and 6 deletions

View file

@ -20,7 +20,8 @@
<link rel="preload" href="https://fonts.codeberg.org/dist/inter/Inter%20Web/inter.css" as="style" />
<link rel="preload" href="https://fonts.codeberg.org/dist/fontawesome6/css/svg-with-js.css" as="style" />
<link rel="stylesheet" type="text/css" href="/halfmoon.css">
<link rel="stylesheet" type="text/css" href="/assets/css/halfmoon/halfmoon.min.css">
<link rel="stylesheet" type="text/css" href="/assets/css/halfmoon/cores/halfmoon.modern.css">
<link rel="stylesheet" type="text/css" href="/assets/css/codeberg-docs.css" />
<!-- Syntax highlighting -->

View file

@ -1,5 +0,0 @@
---
permalink: halfmoon.css
---
{% include "../node_modules/halfmoon/css/halfmoon.min.css" %}
{% include "../node_modules/halfmoon/css/cores/halfmoon.modern.css" %}

View file

@ -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