commit 1c7248d32b1548dcf78647e559959d5ae554ebab
parent 80aa8f6deaa9e726c86d5c7ed5c31165383c16d4
Author: Cem Keylan <cem@ckyln.com>
Date: Sun, 16 Aug 2020 13:54:47 +0300
add 'EXTERN_URL', a url to visit when the logo on the index page is clicked.
Diffstat:
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/config.def b/config.def
@@ -29,6 +29,9 @@ LOGO=
# Title of your stagit page. This will be displayed on the main index.html file.
TITLE=
+# External URL. This will be added to the image on the main index.html file.
+EXTERN_URL=
+
# PLAIN FILES
################################################################################
diff --git a/post-receive b/post-receive
@@ -39,7 +39,10 @@ for repo in "$REPO_DIR/"*/git-daemon-export-ok; do set -- "$@" "${repo%/*}"; don
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"
+ sed "s|\"desc\">Repositories|\"desc\">${TITLE:-Repositories}|" |
+ {
+ [ "$EXTERN_URL" ] && sed "s|<img|<a href=\"$EXTERN_URL\"><img|;s|</td>\$|</a></td>|"
+ } > "$STAGIT_DIR/index.html"
# Install style files
[ "$CSS" ] && install -Dm644 "$CSS" "$STAGIT_DIR/style.css"