diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..d29ec3c --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,14 @@ +source ./scripts/common.sh +#!/usr/bin/env sh + +rm -rf "$STATIC_BUILD" +rm -rf "$OUTPUT_DIR" + +cp -r "$STATIC_SRC/img" "$STATIC_BUILD/img" +cp -r "$STATIC_SRC/js" "$STATIC_BUILD/js" +cp -r "$STATIC_SRC/css" "$STATIC_BUILD/css" +cp -r "$STATIC_SRC/scss" "$STATIC_BUILD/scss" + +hugo gen chromastyles --style=monokai > "$STATIC_BUILD/css/highlight.css" + +hugo -vDEF --gc $@ diff --git a/scripts/common.sh b/scripts/common.sh new file mode 100755 index 0000000..f32ae38 --- /dev/null +++ b/scripts/common.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +BASEDIR="$PWD" +OUTPUT_DIR="$BASEDIR/public" +STATIC_SRC="$BASEDIR/static/src" +STATIC_BUILD="$BASEDIR/static/build" + +[[ -f "$BASEDIR/.env" ]] && export $(cat "$BASEDIR/.env" | xargs) diff --git a/scripts/server.sh b/scripts/server.sh new file mode 100644 index 0000000..0c3156a --- /dev/null +++ b/scripts/server.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +source ./scripts/common.sh + +./scripts/build.sh + +hugo server --noHTTPCache --disableFastRender --gc