-E option now represents html url extension
This is useful for URL rewriting. The -E option was previously used to denote an empty -e and can still be done with `-e ''`. To use a URL rewriting scheme that removes the extension, use -E ''. To support this change properly, and to support users who may not want to use `.' as their extension prefix, it is no longer automatically added. (This breaks backwards compatibility, but -E was pushed publically so recently that this change is likely to affect anyone but, well, me.)master
parent
e7f9e58b63
commit
0e0414027a
11
processor
11
processor
|
@ -34,13 +34,12 @@ outfgen()
|
|||
{
|
||||
ts="${1?Missing timestamp}"
|
||||
id="${2?Missing commit id}"
|
||||
ext="${3:+.$3}"
|
||||
|
||||
dateout="$( ./tsdate "$ts" %Y-%m-%d )"
|
||||
month="$( ./tsdate "$ts" %m )"
|
||||
year="${dateout%%-*}"
|
||||
|
||||
echo "$year/$month/$id$ext"
|
||||
echo "$year/$month/$id"
|
||||
}
|
||||
|
||||
|
||||
|
@ -82,7 +81,9 @@ do-index()
|
|||
lastyear="${lastyear:-$year}"
|
||||
firstyear="$year"
|
||||
|
||||
pagefile="$( outfgen "$ts" "$id" "$html_ext" )"
|
||||
pagefile_base="$( outfgen "$ts" "$id" )"
|
||||
pagefile_url="$pagefile_base$html_url_ext"
|
||||
pagefile="$pagefile_base$html_ext"
|
||||
fmtsubject="$( "$msgfmt" -P < <( echo "$subject"; echo ) )"
|
||||
|
||||
[ "$prevdate" == "$dategroup" ] || {
|
||||
|
@ -90,7 +91,7 @@ do-index()
|
|||
$headout "$dategroup"
|
||||
}
|
||||
|
||||
$lineout "$day" "$pagefile" "$fmtsubject"
|
||||
$lineout "$day" "$pagefile_url" "$fmtsubject"
|
||||
|
||||
prevdate="$dategroup"
|
||||
|
||||
|
@ -107,7 +108,7 @@ do-index()
|
|||
# invoke template
|
||||
"$repotype"/commit2html "$commit" | apply-template commit
|
||||
) > "$path_out/$pagefile" \
|
||||
&& ./hashcache "$hash" "$pagefile" "$subject"
|
||||
&& ./hashcache "$hash" "$pagefile_url" "$subject"
|
||||
done
|
||||
|
||||
$footout
|
||||
|
|
|
@ -89,14 +89,15 @@ cfgpath="$path_tpl/.config"
|
|||
}
|
||||
|
||||
# some initial defaults
|
||||
html_ext="${html_ext:-.html}"
|
||||
export html_ext="${html_ext-.html}"
|
||||
export html_link_ext="${html_link_ext-.html}"
|
||||
do_raw=
|
||||
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:u:C:ER:T:U: opt; do
|
||||
while getopts t:d:c:e:l:f:i:o:u:C:E:R:T:U: opt; do
|
||||
case "$opt" in
|
||||
t) title="$OPTARG";;
|
||||
d) desc="$OPTARG";;
|
||||
|
@ -119,7 +120,7 @@ while getopts t:d:c:e:l:f:i:o:u:C:ER:T:U: opt; do
|
|||
u) repo_url="$OPTARG";;
|
||||
U) repo_commit_url="$OPTARG";;
|
||||
C) html_external_css="$OPTARG";;
|
||||
E) html_ext=;;
|
||||
E) html_link_ext="$OPTARG";;
|
||||
R) rss_count="$OPTARG";;
|
||||
T) ;; #already handled
|
||||
?) exit 64;;
|
||||
|
@ -147,7 +148,7 @@ msgfmt="${msgfmt:-$default}"
|
|||
# make configuration available to all scripts
|
||||
export title desc copyright license msgfmt url_root path_tpl path \
|
||||
html_external_css html_footer html_index_footer html_commit_footer \
|
||||
html_ext html_pre_index html_body_class html_tsep repo_url repo_commit_url
|
||||
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 && {
|
||||
|
|
Loading…
Reference in New Issue