web: fix dev "serve" script
This commit is contained in:
parent
c518e490bb
commit
5bc7754354
1 changed files with 6 additions and 17 deletions
|
|
@ -7,23 +7,12 @@ if [ ! -s lab/fonts ]; then
|
||||||
ln -fs ../../build/fonts lab/fonts
|
ln -fs ../../build/fonts lab/fonts
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# jekyll is a little dumb and resolves the lab/fonts symlink and copies
|
# need to delete generated content so that jekyll, being a little dumb,
|
||||||
# all font files to _site when started. Bad jekyll.
|
# can manage to copy the font files into there again.
|
||||||
# Let's work around that.
|
# 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
|
||||||
rm -rf _site
|
rm -rf _site
|
||||||
sh <<_EOF_ &
|
|
||||||
N=3
|
|
||||||
while [ \$N -gt 0 ]; do
|
|
||||||
sleep 1
|
|
||||||
mkdir -p _site/lab
|
|
||||||
if [ -d _site/lab/fonts ]; then
|
|
||||||
rm -rf _site/lab/fonts
|
|
||||||
else
|
|
||||||
rm -f _site/lab/fonts
|
|
||||||
fi
|
|
||||||
ln -fs ../../../build/fonts _site/lab/fonts
|
|
||||||
let N=N-1
|
|
||||||
done
|
|
||||||
_EOF_
|
|
||||||
|
|
||||||
jekyll serve --limit_posts 20 --watch --host 127.0.0.1 --port 3002
|
jekyll serve --limit_posts 20 --watch --host 127.0.0.1 --port 3002
|
||||||
|
|
|
||||||
Reference in a new issue