Skip to content

Instantly share code, notes, and snippets.

@Kavithvajen
Created July 18, 2020 11:26
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Kavithvajen/93189ed0d7436606c9b562d289d436b9 to your computer and use it in GitHub Desktop.
Save Kavithvajen/93189ed0d7436606c9b562d289d436b9 to your computer and use it in GitHub Desktop.
Z Shell (zsh) script to manage a Hugo site hosted on GitHub Pages. YouTube Link: https://youtu.be/5TrMF_aFa5E
#!/bin/zsh
vared -p "Enter commit message: " -c message
printf "\e[33m\nBuilding project...\e[39m\n"
hugo -d ../YOUR_GITHUB_USERNAME.github.io
printf "\\e[33m\nPushing to YOUR_GITHUB_USERNAME.github.io repository...\e[39m\n\n"
cd ../YOUR_GITHUB_USERNAME.github.io
git add .
git commit -m "$message"
git push origin master
printf "\e[32m\nSuccessfully deployed the website!\e[39m"
printf "\e[33m\n\nNow pushing latest changes to PERSONAL_REPOSITORY_NAME repository...\e[39m\n\n"
cd ../PERSONAL_REPOSITORY_NAME
git add .
git commit -m "$message"
git push origin master
printf "\033[0;32m\nSuccessfully pushed changes to the repository!\e[39m\n"
@InquilineKea
Copy link

do you have a github for this hugo rep?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment