3 # this can only be done from a terminal; do not try to run it from cron or
4 # some other headless mechanism
6 # note: how.html is built manually, using
7 # cd docs; pdh -i how.mkd -o how.html -t html-N
9 # also, a lot of things in here are kinda hardcoded to my setup; if someone
10 # really wants me to clean it up so that it is more generic, I'll work on it
12 die
() { echo "$@"; exit 1; }
14 [ -f mkdocs.yml
] || die
"are you sure you're in the right directory?"
16 [ -d .git
/gen-docs
] && mv .git
/gen-docs .
17 [ "$1" = "clean" ] && rm -rf gen-docs
18 mkdir
-p gen-docs
/{code
,contrib
,css
}
19 rsync
-a docs
/code gen-docs
20 rsync
-a docs
/css gen-docs
21 cp docs
/gitweb.conf.html gen-docs
22 cp docs
/how.html gen-docs
27 for f
in `find . -name "*.gv"; find . -name "*.aa"`
31 [ -f ..
/gen-docs
/$new ] && [ ..
/gen-docs
/$new -nt $f ] && continue
33 ..
/bin
/mkdocs.pre-build.image-gen
$f ..
/gen-docs
/$new
37 # generate mkd with vim-syntax; this step is slow, but this is the simplest
38 # way to support gitolite syntax highlighting in arbitrary markdown.
39 for f
in `find . -name "*.mkd" | sort`
41 [ -f ..
/gen-docs
/$f ] && [ ..
/gen-docs
/$f -nt $f ] && continue
43 ..
/bin
/mkdocs.pre-build.mkd-filter
< $f > ..
/gen-docs
/$f
49 ~
/.local
/bin
/mkdocs build
51 # 2023-03-07 somehow this is overwriting how.html, despite it not being listed in the yml, so we need to copy it again
54 # move them out of my way for normal use (some of my scripts are not
58 # # cater for people holding on to old links
60 # for i in `find -type f -name index.html -printf "%h\n" | sort | cut -c3-`
63 # sed -e "s,%BASE,$i,g" <<EOF > $j.html
66 # <title>redirecting...</title>
67 # <meta http-equiv="refresh" content="2;URL='https://gitolite.com/gitolite/%BASE/index.html'" />
70 # <p>This page has moved; redirecting...</p>
78 rm -rf ..
/sitaramc.github.com
/gitolite
79 mv site ..
/sitaramc.github.com
/gitolite
80 cd ..
/sitaramc.github.com
82 read -p "hit enter to start 'gs' followed by a push:"
83 vim
-s <(echo gs
; echo :only
)