From 76b82ea3c3e0863cf01c1d7519371e9d69a0f12a Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Wed, 30 Dec 2020 13:45:33 -0500 Subject: [PATCH] stagit: Remove custom CSS / setup scripts I recently migrated to a new server and discovered that stagit itself ships with pretty awesome example post-receive and setup (create.sh) scripts, which I easily adapted to my installation. Also, I went back on the gruvbox styling in favor of the default CSS (with a small tweak for the background to be the same F5F5F5 as my site) --- logo.png | Bin 0 -> 5972 bytes stagit/logo.png | Bin 5972 -> 0 bytes stagit/post-receive | 14 -------------- stagit/setup.sh | 36 ------------------------------------ stagit/style.css | 121 ------------------------------------------------------------------------------------------------------------------------- 5 files changed, 171 deletions(-) create mode 100644 logo.png delete mode 100644 stagit/logo.png delete mode 100755 stagit/post-receive delete mode 100755 stagit/setup.sh delete mode 100644 stagit/style.css diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..99709a8 Binary files /dev/null and b/logo.png differ diff --git a/stagit/logo.png b/stagit/logo.png deleted file mode 100644 index 99709a8..0000000 Binary files a/stagit/logo.png and /dev/null differ diff --git a/stagit/post-receive b/stagit/post-receive deleted file mode 100755 index f32a9b3..0000000 --- a/stagit/post-receive +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# based off of: https://rgz.ee/stagit.html -set -e -dst="/var/www/htdocs/git/$(basename "$(pwd)" '.git')" -src="$(pwd)" - -# KEY: run in background (saves a slow push) -mkdir -p "$dst" -(cd "$dst" && stagit "$src") -cp -f "$dst/log.html" "$dst/index.html" - -# Assume run as git, so $HOME has the repos -exported="$(ls $HOME/*.git/git-daemon-export-ok | sed 's/\/git-daemon-export-ok//g')" -stagit-index $exported > /var/www/htdocs/git/index.html diff --git a/stagit/setup.sh b/stagit/setup.sh deleted file mode 100755 index 6728f11..0000000 --- a/stagit/setup.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# setup.sh -- setup repos in $HOME and index for stagit -# meant to be run as the git user, requires stagit installed - -SCRIPTDIR="$(dirname "$(readlink -f "$0")")" - -# First setup the dest -DEST=/var/www/htdocs/git -cp "$SCRIPTDIR/style.css" "$DEST" -cp "$SCRIPTDIR/logo.png" "$DEST" -cp "$SCRIPTDIR/logo.png" "$DEST/favicon.png" - -cd $HOME -for d in *.git; do - if [ -e "$d/git-daemon-export-ok" ]; then - echo "Processing $d" - - # Setup src - cp "$SCRIPTDIR/post-receive" "$d/hooks" - echo "Alex Karle" > "$d/owner" - echo "git://git.alexkarle.com/$d" > "$d/url" - - # Setup dst - base=`basename $d .git` - mkdir -p "$DEST/$base" - cp "$SCRIPTDIR/style.css" "$DEST/$base" - cp "$SCRIPTDIR/logo.png" "$DEST/$base" - cp "$SCRIPTDIR/logo.png" "$DEST/$base/favicon.png" - (cd $DEST/$base && stagit $HOME/$d) - - # Add to the list of things to index... - exported="$exported $d" - fi -done - -stagit-index $exported > $DEST/index.html diff --git a/stagit/style.css b/stagit/style.css deleted file mode 100644 index c977e4b..0000000 --- a/stagit/style.css +++ /dev/null @@ -1,121 +0,0 @@ -/* style.css -- stagit style.css, almost stock from the stagit - * only changes made were to add gruvbox colors */ -body { - color: #ebdbb2; - background-color: #282828; - font-family: "Courrier New", monospace; - font-size: 1.0em; -} - -h1, h2, h3, h4, h5, h6 { - font-size: 1.0em; - margin: 0; -} - -img, h1, h2 { - vertical-align: middle; -} - -img { - border: 0; -} - -a:target { - background-color: #504945; -} - -a.d, -a.h, -a.i, -a.line { - text-decoration: none; -} - -#blob a { - color: #458588; -} - -#blob a:hover { - color: #d79921; - text-decoration: none; -} - -a { - color: #83a598; -} - -a:hover { - color: #d79921; -} - -a:visited { - color: #458588; -} - -table thead td { - font-weight: bold; -} - -table td { - padding: 0 0.4em; -} - -#content table td { - vertical-align: top; - white-space: nowrap; -} - -#branches tr:hover td, -#tags tr:hover td, -#index tr:hover td, -#log tr:hover td, -#files tr:hover td { - background-color: #584945; -} - -#index tr td:nth-child(2), -#tags tr td:nth-child(3), -#branches tr td:nth-child(3), -#log tr td:nth-child(2) { - white-space: normal; -} - -td.num { - text-align: right; -} - -.desc { - color: #689d6a; -} - -hr { - border: 0; - border-top: 1px solid #928374; - height: 1px; -} - -pre { - font-family: "Courrier New", monospace; -} - -pre a.h { - color: #458588; -} - -.A, -span.i, -pre a.i { - color: #98971a; -} - -.D, -span.d, -pre a.d { - color: #cc241d; -} - -pre a.h:hover, -pre a.i:hover, -pre a.d:hover { - text-decoration: none; -} -- libgit2 1.1.1