diff --git a/repo2html b/repo2html
index 26643a4..0fc6af8 100755
--- a/repo2html
+++ b/repo2html
@@ -96,7 +96,7 @@ raw_tpl=
# configuration (note that this setup in conjunction with the below defaults
# imply that they can be passed in as environment variables as an alternative to
# options)
-while getopts t:d:c:e:l:f:i:o:C:ER:T: opt; do
+while getopts t:d:c:e:l:f:i:o:u:C:ER:T:U: opt; do
case "$opt" in
t) title="$OPTARG";;
d) desc="$OPTARG";;
@@ -116,6 +116,8 @@ while getopts t:d:c:e:l:f:i:o:C:ER:T: opt; do
path_out="$path_out/$OPTARG"
fi
;;
+ u) repo_url="$OPTARG";;
+ U) repo_commit_url="$OPTARG";;
C) html_external_css="$OPTARG";;
E) html_ext=;;
R) rss_count="$OPTARG";;
@@ -145,7 +147,7 @@ msgfmt="${msgfmt:-$default}"
# make configuration available to all scripts
export title desc copyright license msgfmt url_root path_tpl path path_root \
html_external_css html_footer html_index_footer html_commit_footer \
- html_ext html_pre_index html_body_class html_tsep
+ html_ext html_pre_index html_body_class html_tsep repo_url repo_commit_url
# if raw processing was requested, then we are done; pass the torch
test $do_raw && {
diff --git a/tpl/commit b/tpl/commit
index 1bc4e01..b07018b 100755
--- a/tpl/commit
+++ b/tpl/commit
@@ -66,7 +66,15 @@ cat <
-
$hash
+
$(
+ if [ -n "$repo_commit_url" ]; then
+ printf '%s' "$hash" "$hash"
+ elif [ -n "$repo_url" ]; then
+ printf '%s' "$repo_url" "$hash"
+ else
+ echo "$hash"
+ fi
+ )