diff options
author | Rasmus Andersson <rasmus@notion.se> | 2018-07-20 06:21:03 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@notion.se> | 2018-08-28 18:09:56 +0300 |
commit | 9a6c2e0202b6453cd1b998bb389d8e81622472f7 (patch) | |
tree | d07bf3a5473585064a20e892b426b950f6c90502 | |
parent | 176d2ce54037d55e521eccc69eecb7ed6e165b75 (diff) | |
download | inter-9a6c2e0202b6453cd1b998bb389d8e81622472f7.tar.xz |
docs: workarounds for poorly-behaving jekyll
-rwxr-xr-x | docs/_scripts/serve.sh | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/docs/_scripts/serve.sh b/docs/_scripts/serve.sh index a319d8e22..1762fa44c 100755 --- a/docs/_scripts/serve.sh +++ b/docs/_scripts/serve.sh @@ -3,7 +3,24 @@ set -e cd "$(dirname "$0")/.." if [ ! -s lab/fonts ]; then - ln -s ../../build/dist lab/fonts + ln -s ../../build/dist-unhinted lab/fonts fi +# jekyll is a little dumb and resolves the lab/fonts symlink and copies +# all font files to _site when started. Fix that. Bad jekyll! +# +# Step 1/2: remove any previous symlink, or jekyll crashes +rm -rf _site/lab/fonts +# +# Step 2/2: create symlink again after some delay. Ugh. +sh <<_EOF_ & +N=3 +while [ \$N -gt 0 ]; do + sleep 1 + rm -rf _site/lab/fonts + ln -s ../../../build/dist-unhinted _site/lab/fonts + let N=N-1 +done +_EOF_ + jekyll serve --limit_posts 20 --watch --host 127.0.0.1 --port 3002 --open-url |