gitdxd-theme/install.sh

36 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-only
# Copyright (C) 2026 dvorakmortonxd
#
# Copy the theme + homepage into a Forgejo custom directory.
#
# Usage:
# ./install.sh /path/to/forgejo/custom
#
# The target is the Forgejo CustomPath (Site Administration -> Configuration).
set -eu
CUSTOM="${1:-}"
if [ -z "$CUSTOM" ] || [ ! -d "$CUSTOM" ]; then
echo "usage: $0 /path/to/forgejo/custom" >&2
exit 1
fi
mkdir -p "$CUSTOM/public/assets/css" \
"$CUSTOM/public/assets/img" \
"$CUSTOM/templates/custom"
cp themes/*.css "$CUSTOM/public/assets/css/"
cp assets/img/*.svg "$CUSTOM/public/assets/img/"
cp templates/home.tmpl templates/home_forgejo.tmpl "$CUSTOM/templates/"
cp templates/custom/header.tmpl "$CUSTOM/templates/custom/"
echo "Files copied to $CUSTOM"
echo
echo "Next, add this to app.ini and restart Forgejo:"
echo
echo " [ui]"
echo " THEMES = forgejo-auto,forgejo-light,forgejo-dark,aurora-dark,aurora-light,gruvbox-dark,gruvbox-light,gruvbox-soft-dark,terminal"
echo " DEFAULT_THEME = aurora-light"
echo
echo "Then hard-refresh the browser (Ctrl+Shift+R)."