site

scripts to generate personal blog and git repositories

git clone https://9o.is/git/site.git

commit 5669131e0b6d4220f1f5e77bc487b178b028709a
parent b295fc20e61c06c7368a22e9ba2341785d1afd2b
Author: Jul <jul@9o.is>
Date:   Tue, 12 May 2026 20:10:07 +0800

sort git repos in index page

Diffstat:
MMakefile | 14++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -27,11 +27,17 @@ $(OUTDIR)/index.html: $(PAGES_HTML) $(PAGES_CFG) $(OUTDIR)/git/index.html: $(REPOS_OUT) @printf " %-8s %s\n" "STAGIT" "$@" @mkdir -p $(OUTDIR)/git - @repos=''; \ + @sorted_repos=$$( \ for repo in $(REPOS); do \ - source $$repo && repos="$$repos $$path"; \ - done; \ - $(STAGIT_INDEX) $$repos > $@ + path=""; \ + . "$$repo"; \ + if [ -n "$$path" ] && [ -d "$$path" ]; then \ + ts=$$(git --git-dir="$$path" log -1 --format="%ct" 2>/dev/null || echo 0); \ + echo "$$ts $$path"; \ + fi; \ + done | sort -rn | cut -d' ' -f2- \ + ); \ + $(STAGIT_INDEX) $$sorted_repos > $@ stagit-all: $(REPOS_OUT) @for repo in $(REPOS); do \