Added -uU options for repo and commit URLs; used by commit template
Will be added to index in the future as welltpl
parent
3fae735d0b
commit
2ff069be4f
|
@ -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 && {
|
||||
|
|
10
tpl/commit
10
tpl/commit
|
@ -66,7 +66,15 @@ cat <<EOF
|
|||
Copyright © $year $copyright.
|
||||
$license
|
||||
</div>
|
||||
<div class="commit-id">$hash</div>
|
||||
<div class="commit-id">$(
|
||||
if [ -n "$repo_commit_url" ]; then
|
||||
printf '<a href="'"$repo_commit_url"'">%s</a>' "$hash" "$hash"
|
||||
elif [ -n "$repo_url" ]; then
|
||||
printf '<a href="%s">%s</a>' "$repo_url" "$hash"
|
||||
else
|
||||
echo "$hash"
|
||||
fi
|
||||
)</div>
|
||||
</footer>
|
||||
</article>
|
||||
</body>
|
||||
|
|
Loading…
Reference in New Issue