Added configurable template path via path_tpl env var (-T option to repo2html)
The .sh extension was removed from the commit filename to recognize the fact that configurable templates may be any type of executable.master
parent
dc99621cc1
commit
397d8837a9
|
@ -26,6 +26,10 @@ path_out="${2?Missing output path}"
|
|||
# provide default message formatter if necessary
|
||||
msgfmt="${msgfmt:-./msgfmt}"
|
||||
|
||||
# default template path (the former is exported so that templates themselves may
|
||||
# make use of default templates)
|
||||
export path_default_tpl=./tpl
|
||||
path_tpl="${path_tpl:-$path_default_tpl}"
|
||||
|
||||
# output XHTML5 header
|
||||
cat <<EOH
|
||||
|
@ -94,7 +98,7 @@ while read hash commit ts id subject; do
|
|||
export path_root='../../'
|
||||
|
||||
# invoke template
|
||||
"$repotype"/commit2html "$commit" | ./tpl/commit.sh
|
||||
"$repotype"/commit2html "$commit" | "$path_tpl/commit"
|
||||
) > "$path_out/$pagefile" \
|
||||
&& ./hashcache "$hash" "$pagefile"
|
||||
done
|
||||
|
|
|
@ -67,7 +67,7 @@ cwarn()
|
|||
# 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:l:f:R: opt; do
|
||||
while getopts t:d:c:l:f:R:T: opt; do
|
||||
case "$opt" in
|
||||
t) title="$OPTARG";;
|
||||
d) desc="$OPTARG";;
|
||||
|
@ -75,6 +75,7 @@ while getopts t:d:c:l:f:R: opt; do
|
|||
l) license="$OPTARG";;
|
||||
f) msgfmt="$OPTARG";;
|
||||
R) rss_count="$OPTARG";;
|
||||
T) path_tpl="$OPTARG";;
|
||||
?) exit 64;;
|
||||
esac
|
||||
done
|
||||
|
@ -96,7 +97,7 @@ license="${license:-$( cwarn license )}"
|
|||
msgfmt="${msgfmt:-./msgfmt}"
|
||||
|
||||
# make configuration available to all scripts
|
||||
export title desc copyright license msgfmt url_root
|
||||
export title desc copyright license msgfmt url_root path_tpl
|
||||
|
||||
# clear the cachefile (TODO: we could maintain cache files from previous runs if
|
||||
# we offer a flag that opts out of reprocessing previously processed commits)
|
||||
|
|
Loading…
Reference in New Issue