Hugo blog site Update
I have finally manage to make my first publish Hugo site. Not without a few issues and cutting myself on the way.
Build Script
I have a bash script that pulls this blog out of it’s own repo, builds it and
then copies itself over to the /var/www
directory.
mv disaster
My First mistake was this line: mv $WWWDIR/* www/blog.x0r.uk/
Now I ran this without $WWWDIR
being set. So it effectively moved /*
root
into my web directory! I called it a day, but fortunately I ran that as a
normal user, so no real damage was done, as it copied files if a mv isn’t
possible.
As a way around it, a friend proposed mv ./$WWWDIR/* www/blog.x0r.uk/
as a
safer alternative. So it will at least start with the present working
directory.
git submodules
When I first run the script on the server to pull the repo, it build a page,
but failed to produce a index.html
, but there was a index.xml
for RSS.
This was a easy spot, as the hugo errors says there was no theme, and I
checked that we had no files checked out. So I had to add the following to the
checkout script: git submodule update --init --recursive
Re-running the hugo build placed the index.html
and all was hunky dory!
Happy Easter Everyone!