Skip to content

Instantly share code, notes, and snippets.

@duke-m
Created August 1, 2018 16:24
Show Gist options
  • Save duke-m/746a2ac18a7d41f01f6f37ce027bb0c4 to your computer and use it in GitHub Desktop.
Save duke-m/746a2ac18a7d41f01f6f37ce027bb0c4 to your computer and use it in GitHub Desktop.
Hugo make and deploy file
# locally
eploy_to=~/html/3
# remove all Thumbs.db (if browsed with a Windows Explorer over sftp)
./no-thumbsdb
# SCSS changed?
# Building an extended Hugo can be a pain on some systems...
echo SCSS...
source_css_dir=themes/forty/assets/sass
target_css_dir=themes/forty/assets/css
source_css=$source_css_dir/main.scss
target_css=$target_css_dir/main.css
echo $source_css_dir changed...?
find $source_css_dir -maxdepth 4 -newer $target_css | egrep '.*'
if [ $? == 0 ]
then
echo Yes, SCSS changed...
scss -t compressed $source_css $target_css
else
echo Nope, SCSS unchanged...
fi
# now Hugo himself
# ATTENTION, target directory will be wiped off first!
echo HUGO...
rm -rf $deploy_to
mkdir $deploy_to
hugo --gc -d $deploy_to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment