2 # - Makes index for repositories in a single directory.
3 # - Makes static pages for each repository directory.
5 # NOTE, things to do manually (once):
6 # - copy style.css, logo.png and favicon.png manually, a style.css example
8 # - write clone url, for example "git://git.codemadness.org/dir" to the "url"
12 # - mkdir -p htmldir && cd htmldir
15 reposdir="/var/www/domains/git.codemadness.nl/home/src"
20 find . -maxdepth 1 -type d | grep -v "^.$" | sort | xargs stagit-index |
21 sed 's@<td>Last commit</td>@<td><a href="index-time.html">Last commit</a></td>@g' | \
22 sed 's@<td>Name</td>@<td><a href="index.html">Name</a></td>@g' > "${curdir}/index.html"
24 # make index (sort by last commit author time).
25 find . -maxdepth 1 -type d | grep -v "^.$" | while read -r dir; do
26 d=$(basename "${dir}")
28 timestamp=$(git show -s --pretty="format:%at" || true)
30 printf "%d %s\n" "${timestamp}" "${d}"
31 done | sort -n -k 1 | cut -f 2- -d ' ' | xargs stagit-index | \
32 sed 's@<td>Last commit</td>@<td><a href="index-time.html">Last commit</a></td>@g' | \
33 sed 's@<td>Name</td>@<td><a href="index.html">Name</a></td>@g' > "${curdir}/index-time.html"
35 # make files per repo.
37 find . -maxdepth 1 -type d | grep -v "^.$" | sort | while read -r dir; do
38 d=$(basename "${dir}")
41 mkdir -p "${curdir}/${d}"
43 stagit "${reposdir}/${d}"
46 ln -sf log.html index.html
47 ln -sf ../style.css style.css
48 ln -sf ../logo.png logo.png
49 ln -sf ../favicon.png favicon.png