Quick and dirty info about how this site works:
Hosting: Firebase - comes with free SSL cert
Version Management: GitHub
Build: Hugo (KeepIt theme)
The
hugo
site project folder is also a git repo.
Pipeline: I write a new post with the command scblog <post-name>.md
, which is a custom function in my .zprofile
. It opens the new post in the Atom text editor:
function scblog {
export HERE=$(pwd)
cd ~/hugo/samcipriani.com/
hugo new posts/$1
atom content/posts/$1
cd $HERE
}
After writing a post, I just run deploy.sh
:
#!/bin/zsh
echo -e "Deploying updates to GitHub..."
# Build the project.
hugo -D
git add .
# Commit changes.
msg="rebuilding samcipriani.com site `date`"
git commit -m "$msg"
# Push source and build repos.
git push origin HEAD
firebase deploy
Notice the firebase deploy
command - this is a very useful set of CLI tools by Google. It is configured to deploy from the ./public
directory; likewise hugo
is configured to build the site to the ./public
directory.