2015-12-26 19:46:33 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# - Makes index for repositories in a single directory.
|
|
|
|
# - Makes static pages for each repository directory.
|
|
|
|
#
|
2017-07-15 11:50:24 +00:00
|
|
|
# NOTE, things to do manually (once) before running this script:
|
2015-12-26 19:46:33 +00:00
|
|
|
# - copy style.css, logo.png and favicon.png manually, a style.css example
|
|
|
|
# is included.
|
2017-07-15 11:50:24 +00:00
|
|
|
#
|
2021-07-30 23:09:45 +00:00
|
|
|
# - write clone URL, for example "git://git.codemadness.org/dir" to the "url"
|
2015-12-26 19:46:33 +00:00
|
|
|
# file for each repo.
|
2017-07-15 11:50:24 +00:00
|
|
|
# - write owner of repo to the "owner" file.
|
|
|
|
# - write description in "description" file.
|
2015-12-26 19:46:33 +00:00
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
# - mkdir -p htmldir && cd htmldir
|
2017-07-30 15:21:42 +00:00
|
|
|
# - sh example_create.sh
|
2015-12-26 19:46:33 +00:00
|
|
|
|
2016-09-15 18:44:47 +00:00
|
|
|
# path must be absolute.
|
2016-01-08 12:39:23 +00:00
|
|
|
reposdir="/var/www/domains/git.codemadness.nl/home/src"
|
2017-07-30 15:21:42 +00:00
|
|
|
curdir="$(pwd)"
|
2015-12-26 19:46:33 +00:00
|
|
|
|
|
|
|
# make index.
|
2016-09-15 18:44:47 +00:00
|
|
|
stagit-index "${reposdir}/"*/ > "${curdir}/index.html"
|
2015-12-26 19:46:33 +00:00
|
|
|
|
|
|
|
# make files per repo.
|
2016-09-15 18:44:47 +00:00
|
|
|
for dir in "${reposdir}/"*/; do
|
|
|
|
# strip .git suffix.
|
2016-05-29 11:06:32 +00:00
|
|
|
r=$(basename "${dir}")
|
|
|
|
d=$(basename "${dir}" ".git")
|
2016-04-29 14:38:48 +00:00
|
|
|
printf "%s... " "${d}"
|
2016-01-05 21:32:11 +00:00
|
|
|
|
2016-01-08 21:17:54 +00:00
|
|
|
mkdir -p "${curdir}/${d}"
|
2019-03-01 10:49:29 +00:00
|
|
|
cd "${curdir}/${d}" || continue
|
2021-03-05 11:44:48 +00:00
|
|
|
stagit -c ".cache" -u "https://git.codemadness.nl/$d/" "${reposdir}/${r}"
|
2015-12-26 19:46:33 +00:00
|
|
|
|
2016-01-05 20:40:26 +00:00
|
|
|
# symlinks
|
|
|
|
ln -sf log.html index.html
|
|
|
|
ln -sf ../style.css style.css
|
|
|
|
ln -sf ../logo.png logo.png
|
|
|
|
ln -sf ../favicon.png favicon.png
|
2016-01-08 21:17:54 +00:00
|
|
|
|
2017-07-30 15:21:42 +00:00
|
|
|
echo "done"
|
2015-12-26 19:46:33 +00:00
|
|
|
done
|