Add some scripts for faster workflow

This commit is contained in:
ItsDrike 2021-08-24 20:27:52 +02:00
parent e6db609303
commit d23d5f6c61
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD
3 changed files with 29 additions and 0 deletions

14
scripts/build.sh Executable file
View file

@ -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 $@

8
scripts/common.sh Executable file
View file

@ -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)

7
scripts/server.sh Normal file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env sh
source ./scripts/common.sh
./scripts/build.sh
hugo server --noHTTPCache --disableFastRender --gc