diff --git a/convert.sh b/convert.sh index 805446f..07c8536 100755 --- a/convert.sh +++ b/convert.sh @@ -62,7 +62,6 @@ wait mkdir -p ./_site/css mkdir -p ./_site/js mkdir -p ./_site/fonts -cp ./css/base.css ./_site/css/base.css -cp ./js/main.js ./_site/js/main.js -cp ./favicon.ico ./_site/favicon.ico +sed -e "s:{{SITE_ROOT}}:$SITE_ROOT:g" ./css/base.css > ./_site/css/base.css +sed -e "s:{{SITE_ROOT}}:$SITE_ROOT:g" ./js/main.js > ./_site/js/main.js cp ./fonts/* ./_site/fonts/ || true diff --git a/env b/env index 0cea882..1bf87fd 100644 --- a/env +++ b/env @@ -1,3 +1,5 @@ -export SITE_ROOT="/simple-site" -export SITE_TITLE="Simple Site" -export CRUMBS="YES" +[ -z "$SITE_ROOT" ] && export SITE_ROOT="/simple-site" +[ -z "$SITE_TITLE" ] && export SITE_TITLE="Simple Site" +[ -z "$CRUMBS" ] && export CRUMBS="YES" + +[ "$SITE_ROOT" = "/" ] && export SITE_ROOT=""