fix: serve halfmoon css through addPassthroughCopy

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
This commit is contained in:
0ko 2026-05-31 17:45:12 +05:00
parent e0fe2eaa66
commit 9ce85d5781
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