diff --git a/processor b/processor index 3c29c70..39c6b44 100755 --- a/processor +++ b/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 diff --git a/repo2html b/repo2html index 48bc272..48ab1ef 100755 --- a/repo2html +++ b/repo2html @@ -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 && {