commit 166734e6b1424c2764d137d59005f8ab0f48eaab parent 6544bb0d45254cf3e788b66dd3a924f8dc1525d4 Author: Ryan Sepassi <rsepassi@gmail.com> Date: Sat, 18 Apr 2026 02:27:43 -0700 index: link repo name to README.md.html when present Diffstat:
| M | bin/stagit-update | | | 16 | ++++++++++++++++ |
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/bin/stagit-update b/bin/stagit-update @@ -112,9 +112,23 @@ for r in "$REPOS"/*.git; do fi done +# After stagit-index runs, point each repo's row link at file/README.md.html +# instead of log.html when a rendered README exists. +readme_link_rewrite() { + idx=$1; base=$2; shift 2 + [ -f "$idx" ] || return 0 + for repo in "$@"; do + name=$(basename "$repo" .git) + [ -f "$base/$name/file/README.md.html" ] || continue + sed -i "s|href=\"$name/log\\.html\"|href=\"$name/file/README.md.html\"|g" "$idx" + done +} + if [ -n "$all_list" ]; then # shellcheck disable=SC2086 stagit-index $all_list > "$PRIV/index.html" + # shellcheck disable=SC2086 + readme_link_rewrite "$PRIV/index.html" "$PRIV" $all_list else : > "$PRIV/index.html" fi @@ -122,6 +136,8 @@ fi if [ -n "$pub_list" ]; then # shellcheck disable=SC2086 stagit-index $pub_list > "$PUB/index.html" + # shellcheck disable=SC2086 + readme_link_rewrite "$PUB/index.html" "$PUB" $pub_list else : > "$PUB/index.html" fi