commit 3cb4ba1982a46f6e3018c0251b513cffd51d0743
parent a353d0d23b18f10680c3053c8e9f1e1206576263
Author: Cem Keylan <cem@ckyln.com>
Date: Thu, 13 Aug 2020 14:39:40 +0300
post-receive: change stagit-index format. Display main TITLE
This redirects to 'index.html' instead of 'log.html'. It will also display
the title on the main page.
Diffstat:
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/config.def b/config.def
@@ -26,6 +26,9 @@ CSS=
FAVICON=
LOGO=
+# Title of your stagit page. This will be displayed on the main index.html file.
+TITLE=
+
# PLAIN FILES
################################################################################
diff --git a/post-receive b/post-receive
@@ -35,7 +35,10 @@ mkdir -p "$STAGIT_DIR/$repository"
# Generate the index for every exported repository
set --
for repo in "$REPO_DIR/"*/git-daemon-export-ok; do set -- "$@" "${repo%/*}"; done
-stagit-index "$@" > "$STAGIT_DIR/index.html"
+stagit-index "$@" |
+ sed 's|log\.html|index.html|' |
+ sed "s|<title>Repositories</title>|<title>${TITLE:-Repositories}</title>|" |
+ sed "s|\"desc\">Repositories|\"desc\">${TITLE:-Repositories}|" > "$STAGIT_DIR/index.html"
# Install style files
[ "$CSS" ] && install -Dm644 "$CSS" "$STAGIT_DIR/style.css"