Skip to content
Snippets Groups Projects
build-page.sh 600 B
Newer Older
Kwangjin Lee's avatar
Kwangjin Lee committed
#!/bin/bash

PAGE_ROOT=${1:-"/"}
Kwangjin Lee's avatar
Kwangjin Lee committed
IS_PUBLISH_DEPLOYMENT=${2:-false}
Kwangjin Lee's avatar
Kwangjin Lee committed

PAGE_ROOT=$(echo "$PAGE_ROOT" | sed 's:/*$::')

Kwangjin Lee's avatar
Kwangjin Lee committed
if [ "$IS_PUBLISH_DEPLOYMENT" = true ]; then
    echo "Using publish deployment strategy"
Kwangjin Lee's avatar
Kwangjin Lee committed
    CONFIG_FILE="_config.yml"
Kwangjin Lee's avatar
Kwangjin Lee committed
else
    echo "Using draft deployment strategy"
Kwangjin Lee's avatar
Kwangjin Lee committed
    CONFIG_FILE="_config_draft.yml"
Kwangjin Lee's avatar
Kwangjin Lee committed
fi
Kwangjin Lee's avatar
Kwangjin Lee committed

Kwangjin Lee's avatar
Kwangjin Lee committed
echo "Using config file: $CONFIG_FILE"
echo "Config file contents:"
cat "$CONFIG_FILE"
Kwangjin Lee's avatar
Kwangjin Lee committed

echo "Publishing to page root: \"$PAGE_ROOT\""
Kwangjin Lee's avatar
Kwangjin Lee committed
bundle exec jekyll build -d public -b "$PAGE_ROOT" --config "$CONFIG_FILE"
Kwangjin Lee's avatar
Kwangjin Lee committed

echo "Build complete. Contents of public directory:"
ls -R public