stagit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit c1429dc7e54a5af9f3e291d3033d05d7c095eb02
parent 5334f3e0009bb7d5835c3bad60db507bfd146930
Author: Andrew Laack <andrew@laack.co>
Date:   Wed, 22 Apr 2026 05:14:48 +0000

Update paths

Diffstat:
Acreate.sh | 43+++++++++++++++++++++++++++++++++++++++++++
Dexample_create.sh | 43-------------------------------------------
2 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/create.sh b/create.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# - Makes index for repositories in a single directory. +# - Makes static pages for each repository directory. +# +# NOTE, things to do manually (once) before running this script: +# - copy style.css, logo.png and favicon.png manually, a style.css example +# is included. +# +# - write clone url, for example "git://git.codemadness.org/dir" to the "url" +# file for each repo. +# - write owner of repo to the "owner" file. +# - write description in "description" file. +# +# Usage: +# - mkdir -p htmldir && cd htmldir +# - sh example_create.sh + +# path must be absolute. +reposdir="/srv/git" +curdir="/srv/www/git" + +# make index. +stagit-index "${reposdir}/"*/ > "${curdir}/index.html" + +# make files per repo. +for dir in "${reposdir}/"*/; do + # strip .git suffix. + r=$(basename "${dir}") + d=$(basename "${dir}" ".git") + printf "%s... " "${d}" + + mkdir -p "${curdir}/${d}" + cd "${curdir}/${d}" || continue + stagit -c ".cache" "${reposdir}/${r}" + + # 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 + + echo "done" +done diff --git a/example_create.sh b/example_create.sh @@ -1,43 +0,0 @@ -#!/bin/sh -# - Makes index for repositories in a single directory. -# - Makes static pages for each repository directory. -# -# NOTE, things to do manually (once) before running this script: -# - copy style.css, logo.png and favicon.png manually, a style.css example -# is included. -# -# - write clone url, for example "git://git.codemadness.org/dir" to the "url" -# file for each repo. -# - write owner of repo to the "owner" file. -# - write description in "description" file. -# -# Usage: -# - mkdir -p htmldir && cd htmldir -# - sh example_create.sh - -# path must be absolute. -reposdir="/var/www/domains/git.codemadness.nl/home/src" -curdir="$(pwd)" - -# make index. -stagit-index "${reposdir}/"*/ > "${curdir}/index.html" - -# make files per repo. -for dir in "${reposdir}/"*/; do - # strip .git suffix. - r=$(basename "${dir}") - d=$(basename "${dir}" ".git") - printf "%s... " "${d}" - - mkdir -p "${curdir}/${d}" - cd "${curdir}/${d}" || continue - stagit -c ".cache" "${reposdir}/${r}" - - # 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 - - echo "done" -done