Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
11 changes: 7 additions & 4 deletions build-site
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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"

Expand Down