Delete public folder before every build?

@caseydm A few things, and I hope I’m not overstepping my bounds, but your new site (looks great, btw, keep at it!) says you are just getting into web dev. Me too, so maybe I can save you some headaches, but keep in mind this is just my approach to the workflow.

  1. Move your CNAME and robots.txt to your static folder. This will make sure it copies to your public/ folder on each build. The rule is that anything that ends up in static/ is copied exactly as-is into your public folder.

  2. It looks like you’re using your GH Pages repo just for the build. Have you considered putting everything under source control, or are you keeping your source files versioned elsewhere? If you want to keep everything in the same repo, I believe GH pages will assume a gh-pages/ branch is actually your distribution folder. If you want to change it from the command line using git, here’s a good article that will help you push to gh-pages from master.

  3. Keep in mind that your commit messages should contain enough information that you can look back on them; otherwise, you’re degrading the value of the versioning. I would change your bash script to a separate file titled build-and-deploy-hugo.sh and keep it in the root of your project (note: not the root of your public website), then add variables ($1 $2) so that you can still add proper commits at the command line before pushing it to the live site. Then you can add an alias if you really want to keep your fingers lazy. This will come in handy if you’re making a lot of content-related changes and want to look back at what you’ve written (think of it like comments in a Word doc). Let me know if you need further help.