tcreate.sh - stagit - [fork] customized build of stagit, the static git page generator
(HTM) git clone git://src.adamsgaard.dk/stagit
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
tcreate.sh (1300B)
---
1 #!/bin/sh
2 # - Makes index for repositories in a single directory.
3 # - Makes static pages for each repository directory.
4 #
5 # NOTE, things to do manually (once) before running this script:
6 # - copy style.css, logo.png and favicon.png manually, a style.css example
7 # is included.
8 #
9 # - write clone url, for example "git://git.codemadness.org/dir" to the "url"
10 # file for each repo.
11 # - write owner of repo to the "owner" file.
12 # - write description in "description" file.
13 #
14 # Usage:
15 # - mkdir -p htmldir && cd htmldir
16 # - sh example_create.sh
17
18 # path must be absolute.
19 reposdir="/home/git"
20 curdir="$(pwd)"
21
22 # make index.
23 stagit-index "${reposdir}/"*/ > "${curdir}/index.html"
24
25 echo "User-agent: *" > robots.txt
26
27 # make files per repo.
28 for dir in "${reposdir}/"*/; do
29 # strip .git suffix.
30 r=$(basename "${dir}")
31 d=$(basename "${dir}" ".git")
32 printf "%s... " "${d}"
33
34 mkdir -p "${curdir}/${d}"
35 cd "${curdir}/${d}" || continue
36 stagit -c ".cache" "${reposdir}/${r}"
37
38 # symlinks
39 ln -sf log.html index.html
40 ln -sf ../style.css style.css
41 ln -sf ../logo.png logo.png
42 ln -sf ../favicon.png favicon.png
43
44 echo "Disallow: /${r}/file/\nDisallow: /${r}/commit/\n" >> "${curdir}/robots.txt"
45
46 echo "done"
47 done