clone the blog with
git clone --recurse-submodules git@github.com:evillogic/infosec-blog.git
create a new page with
hugo new <page-name>.md
Building the pages is simply hugo
, however due to submodule behavior we need to first checkout the master submodule branch. You can then simply navigate to the public directory and push the change.
The workflow looks something like this:
- build the new content
- the new content is written to the public folder, a submodule pointing to evillogic/evillogic.github.io
- push the new contents of the submodule
- update the submodule reference in this repository (evillogic/infosec-blog)
- push the new references to the master branch of this repository
Here is the script to do the job:
pushd public
git checkout master
popd
hugo
pushd public
git add -A
git commit -m "added some content"
git push
popd
git submodule update --remote --merge
git add -A
git commit -m "update the submodule pointer and add source content"
git push
Or here is a handy alias which can be invoked with an argument commit message
alias update-blog='f(){ pushd public; git checkout master; popd; hugo; pushd public; git add .; git commit -m "$@"; git push; popd; git submodule update --remore --merge; git add .; git commit -m "$@"; git push; unset -f f; }; f'