From 68726e555ead25c55be8bfadba2a763432abca70 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 22 Jan 2009 05:25:26 +0100 Subject: [PATCH] Make the gitweb URL configurable, so that others can use the blog engine If you are interested in using the same blog engine, you can fork from the 'blog' branch, and set gitweb.url (of course _after_ "git rm source-* && git commit"!). The gitweb.url must be the URL to the remote gitweb which shall serve your blog. In my case, it is http://repo.or.cz/w/git/dscho.git. Signed-off-by: Johannes Schindelin --- upload.sh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/upload.sh b/upload.sh index 83beeca0f7..6b9364868b 100755 --- a/upload.sh +++ b/upload.sh @@ -13,9 +13,24 @@ # TODO: handle images (git add them and rewrite the URL dynamically) # TODO: generate an RSS feed, too +# TODO: generate TOC +# TODO: have a configurable maximum number of entries per page, and links +# to older pages +# TODO: include the commit name in the URL, so that images will be found +# make sure we're in the correct working directory +cd "$(dirname "$0")" + +GITWEBURL="$(git config gitweb.url)" +test -z "$GITWEBURL" && { + echo "Please set gitweb.url in the Git config first!" >&2 + exit 1 +} + +URLPREFIX="$(dirname "$GITWEBURL")"/ +REMOTEREPOSITORY="$(basename "$GITWEBURL")" BRANCH=blog -URL="dscho.git?a=blob_plain;hb=$BRANCH;f=" +URL="$REMOTEREPOSITORY?a=blob_plain;hb=$BRANCH;f=" CSS=blog.css NEW=new OUTPUT=index.html @@ -150,14 +165,11 @@ EOF } -# make sure we're in the correct working directory -cd "$(dirname "$0")" - # parse command line option case "$1" in *dry*) DRYRUN=1; shift;; *show*) firefox "$(pwd)"/$TEST; exit;; -*remote*) firefox http://repo.or.cz/w/git/$URL$OUTPUT; exit;; +*remote*) firefox $URLPREFIX$URL$OUTPUT; exit;; esac test "$#" = 0 || -- 2.11.4.GIT