From 161f582a57dbdfa2eb94fd390fa7b1afaf22115a Mon Sep 17 00:00:00 2001 From: whereareiam Date: Sat, 5 Sep 2026 22:38:30 +0200 Subject: [PATCH] fix(release): package template styles and scripts at install paths --- .github/actions/build-release-assets/package.sh | 15 ++++++++++++++- README.md | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-release-assets/package.sh b/.github/actions/build-release-assets/package.sh index 0e63ee40..b3a17445 100644 --- a/.github/actions/build-release-assets/package.sh +++ b/.github/actions/build-release-assets/package.sh @@ -22,5 +22,18 @@ bun release theme-github-pink-*.css theme-github-gitea-*.css theme-github-catppuccin-*.css ) -tar -zcf dist/theme-github-templates.tar.gz templates -C dist assets/js +# Template assets must extract beside templates under the documented custom root. +# Keep page-specific styles out of theme packs; they are required by the templates. +template_stage=$(mktemp -d) +trap 'rm -rf "$template_stage"' EXIT +mkdir -p "$template_stage/public/assets/css" "$template_stage/public/assets/js" +cp -R templates "$template_stage/templates" +cp -R dist/assets/js/. "$template_stage/public/assets/js/" +for stylesheet in dist/*.css; do + case "${stylesheet##*/}" in + theme-*) ;; + *) cp "$stylesheet" "$template_stage/public/assets/css/" ;; + esac +done +tar -zcf dist/theme-github-templates.tar.gz -C "$template_stage" templates public tar -zcf dist/theme-github-fonts.tar.gz -C dist assets/fonts diff --git a/README.md b/README.md index b12fc319..46e14b13 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Install the resulting files using your Forgejo data directory (commonly `data/gi 3. Extract `theme-github-fonts.tar.gz` into `/public`. This supplies the Mona Sans variable font; its SIL Open Font License is included beside the font. 4. Extract the optional `theme-github-templates.tar.gz` archive into ``. It includes the templates and - their required JavaScript assets. + their required JavaScript and page-specific CSS assets under `public/assets`. 5. Modify `/conf/app.ini` and append the CSS filename without the `theme-` prefix to `THEMES` under the `[ui]` section. 6. Restart Forgejo.