summaryrefslogtreecommitdiff
path: root/render_locally
diff options
context:
space:
mode:
Diffstat (limited to 'render_locally')
-rwxr-xr-xrender_locally106
1 files changed, 79 insertions, 27 deletions
diff --git a/render_locally b/render_locally
index 01bfe5a8..ca7856f5 100755
--- a/render_locally
+++ b/render_locally
@@ -1,36 +1,88 @@
#!/bin/sh
-# Render the pages of this repository for your local browsing pleasure.
+# Render the pages of this repository.
-# We use ``--no-usedirs'' here, because when browsing local files, the web
-# browsers don't display `index.html' files by default when a hyperlink
-# referencing a directory is being opened.
+# Written by Thomas Schwinge <tschwinge@gnu.org>.
-# Written by Thomas Schwinge <tschwinge@gnu.org>
+# See `contributing/web_pages' for further information.
+export ROOT && ROOT=$(readlink -f "$(dirname "$0")") &&
-src=$(dirname "$0") &&
-# Invoking ikiwiki with ``src=.'' will make it render `.git/' as well.
-case $src in
- .*) src=$(cd "$src" && pwd);;
- *) :;;
+# Don't translate.
+export LC_MESSAGES && LC_MESSAGES=C &&
+
+case $1 in
+ # Use this for rendering the set of pages which are to be installed under
+ # <http://www.gnu.org/software/hurd/>.
+ --official)
+ shift &&
+
+ export TZ && TZ=UTC &&
+ export DESTDIR && DESTDIR=$ROOT.rendered.official &&
+
+ # Use ``--no-usedirs'' here, so that not too many separate directories have
+ # to be created.
+ #
+ # Use ``--gettime --plugin update_mtimes'' to reset pages' / files' mtimes
+ # according to the RCS information when using --refresh mode.
+ set x \
+ --set wikistatedir="$ROOT"/.ikiwiki-official \
+ --url http://www.gnu.org/software/hurd \
+ --no-usedirs \
+ --gettime --plugin reset_mtimes \
+ "$@" &&
+ shift;;
+
+ --w3m-wrapper)
+ shift &&
+
+ export NO_MSG && NO_MSG=y &&
+
+ # Disable the configured VCS, as the CGI wrapper together with using the
+ # anonok plugin inhibits the propagation of authorship information.
+ set x \
+ --cgi --wrapper ~/.ikiwiki/wrappers/hurd-web.cgi \
+ --plugin anonok \
+ --rcs norcs \
+ "$@" &&
+ shift &&
+
+ exec \
+ "$0" \
+ --w3m \
+ "$@";;
+
+ --w3m)
+ shift &&
+
+ export DESTDIR && DESTDIR=$ROOT.rendered.w3m &&
+
+ set x \
+ --set wikistatedir="$ROOT"/.ikiwiki-w3m \
+ --cgiurl hurd-web.cgi --w3mmode \
+ "$@" &&
+ shift &&
+
+ exec \
+ "$0" \
+ "$@";;
+
+ *)
+ # Use ``--no-usedirs'' here, because when browsing local files, the web
+ # browsers don't display `index.html' files by default when a hyperlink
+ # referencing a directory is being opened.
+ set x \
+ --no-usedirs \
+ "$@" &&
+ shift;;
esac &&
-dest=$src.rendered &&
ikiwiki \
- --verbose \
- --wikiname GNU\ Hurd\ wiki \
- --templatedir "$src"/.templates \
- --userdir user \
- --no-usedirs \
- --plugin favicon \
- --plugin goodstuff \
- --plugin sidebar \
- --plugin table \
- --libdir "$src"/.library \
- --plugin license \
- ${1+"$@"} \
- "$src" "$dest" &&
-
-echo &&
-echo Now\ open\ \`"$dest"/index.html\'' to browse the wiki pages.'
+ --setup "$ROOT"/ikiwiki.setup \
+ --refresh \
+ "$@" &&
+
+if [ ${NO_MSG-n} = y ]; then :; else
+ echo &&
+ echo Now\ open\ \`"${DESTDIR-"$ROOT".rendered}"/index.html\'' to browse the web pages.'
+fi