From a788c0f520afc923cc291693705f44f52c2a3b2e Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 14 Jan 2021 20:29:23 +0100 Subject: Compile drafts in watch/serve mode --- Makefile | 2 ++ scripts/build_content.sh | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a72a148..db7db81 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ compress_br: build_only @echo -e "\033[0;32m[COMPRESS]\033[0m Brotli" @brotli -k -- `find output -type f -iregex '.*\\.\\(css\\|js\\|json\\|html\\|xml\\|txt\\|svg\\|ico\\|woff\\)'` +build: export LIVE=false build: compress_gz compress_br watch_sass: build_only @@ -40,6 +41,7 @@ watch_metadata: build_only watch_filters: build_only @scripts/watch_filters.sh +watch: export LIVE=true watch: watch_sass watch_content watch_templates watch_metadata watch_filters serve_only: build_only diff --git a/scripts/build_content.sh b/scripts/build_content.sh index 97f57a3..41c2a4b 100755 --- a/scripts/build_content.sh +++ b/scripts/build_content.sh @@ -178,10 +178,15 @@ handle () { fi } +mdfilter="" +if [ "$LIVE" != true ]; then + mdfilter="! -name _*.md" +fi + if [ -z "$1" ]; then find "$CONTENT_DIR" \ -type f \ - ! -name "_*.md" \ + $mdfilter \ | while read file_in do handle "$file_in" @@ -190,7 +195,7 @@ elif [ "$1" = "all_md" ]; then find "$CONTENT_DIR" \ -type f \ -name "*.md" \ - ! -name "_*.md" \ + $mdfilter \ | while read file_in do handle "$file_in" -- cgit v1.2.3-70-g09d2