diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b5cb280 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +# When doing local development on .md files, just run make to build the files +# that changed rather than all. +# +# If src/template_* files are changed, all files need to be re-built + +all: + @ONLY_BUILD_FILES_THAT_CHANGED=t ./build-site diff --git a/build-site b/build-site index ddb3521..e41fcb3 100755 --- a/build-site +++ b/build-site @@ -1,15 +1,16 @@ #!/usr/bin/env bash - : ${DEPLOY_DIR:=deploy} +: ${ONLY_BUILD_FILES_THAT_CHANGED:=f} build_src_pages () { for md in src/*.md; do html=${md##*/} html="${DEPLOY_DIR}/${html/%.md/.html}" - # only build files that have changed - [[ $html -ot $md ]] || continue + if [[ $ONLY_BUILD_FILES_THAT_CHANGED = "t" ]]; then + [[ $html -ot $md ]] || continue + fi echo "Converting $md to $html" @@ -26,7 +27,9 @@ build_man_pages () { html=${scd##*/} html="${DEPLOY_DIR}/${html/%.scd/.html}" - [[ $html -ot $scd ]] || continue + if [[ $ONLY_BUILD_FILES_THAT_CHANGED = "t" ]]; then + [[ $html -ot $scd ]] || continue + fi echo "Converting $scd to $html"