From b8c47c32b3e35c930111e5859496790fd0a811fd Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Wed, 20 Jan 2021 10:32:24 -0800 Subject: [PATCH] Added `watch.sh` for compiling SCSS with native sass compiler --- CHANGELOG.md | 4 +++- themes/grav/watch.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100755 themes/grav/watch.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index e7f018ef..fe6051d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ # v1.10.1 ## 01/20/2021 -1. [](#bugfix) +1. [](#improved) + * Added `watch.sh` for compiling SCSS with native sass compiler +2. [](#bugfix) * Fixed issue with overlapping sidebar when using fullscreen editor [#2022](https://github.com/getgrav/grav-plugin-admin/issues/2022) # v1.10.0 diff --git a/themes/grav/watch.sh b/themes/grav/watch.sh new file mode 100755 index 00000000..de3654d4 --- /dev/null +++ b/themes/grav/watch.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# +# Configuration +# + +# sass source + +SASS_SOURCE_PATH="scss" + +# sass options +SASS_OPTIONS="--source-map=true --style=nested" + +# css target +CSS_TARGET_PATH="css-compiled" + +# +# Check prerequisites +# +wtfile=$(command -v wt) || { echo "install wellington with 'brew install wellington"; exit 1; } + +# +# Watch folder for changes +# +cd -P `pwd` +$wtfile compile "$SASS_SOURCE_PATH" -b "$CSS_TARGET_PATH" $SASS_OPTIONS +$wtfile watch "$SASS_SOURCE_PATH" -b "$CSS_TARGET_PATH" $SASS_OPTIONS