2018-02-20 12:38:51 +03:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
2022-05-26 21:20:06 +03:00
|
|
|
if [ "$1" = "-h" ]; then
|
2018-10-08 04:32:03 +03:00
|
|
|
echo "usage: $0 [<bindaddr>]" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-05-26 21:20:06 +03:00
|
|
|
BINDADDR=${1:-127.0.0.1}
|
|
|
|
|
2018-09-12 09:40:33 +03:00
|
|
|
if [ ! -s lab/fonts ]; then
|
2018-09-17 20:35:12 +03:00
|
|
|
rm -f lab/fonts
|
2018-09-10 20:21:55 +03:00
|
|
|
ln -fs ../../build/fonts lab/fonts
|
2018-02-20 12:38:51 +03:00
|
|
|
fi
|
|
|
|
|
2018-09-27 19:13:49 +03:00
|
|
|
# need to delete generated content so that jekyll, being a little dumb,
|
|
|
|
# can manage to copy the font files into there again.
|
|
|
|
# Why not a symlink you ask? Jekyll traverses it and copies the content.
|
|
|
|
# In the past we tried to work around this by periodically removing the
|
|
|
|
# copied font files and re-creating the symlink, but it was a frail process.
|
|
|
|
# For live testing with fonts, you'll instead want to use docs/lab/serve.py
|
2018-09-17 20:35:12 +03:00
|
|
|
rm -rf _site
|
2018-07-20 06:21:03 +03:00
|
|
|
|
2022-05-26 21:20:06 +03:00
|
|
|
bundle exec jekyll serve \
|
2019-02-07 20:38:39 +03:00
|
|
|
--watch \
|
|
|
|
--host "$BINDADDR" \
|
|
|
|
--port 3002 \
|
2019-02-19 18:23:24 +03:00
|
|
|
--livereload \
|
|
|
|
--livereload-port 30002
|