Hugo on Android
I mentioned back in 2019 that I needed to writeup how I’m using hugo to build this static site on my Android phone. So here it is! Only 3 years later
- First I’ve got my complete setup to clone the git repo written here (just updated!).
apt install hugo
in termux
- cd to the hugo folder
- run with drafts locally with
hugo server -D --noBuildLock
- Go to http://localhost:1313 to review
- kill with ctrl+c when done
- Do a final build with
hugo --noBuildLock
- Then push with rsync as detailed in another of my old writeups
I’ve had to add the –noBuildLock flag to the hugo commands because of an issue with build lock on Android.
Originally I had an issue where the css wouldn’t build on Android. I switched to sass from less when Hugo added support for it. Now my sass compiles just fine.
-
I’m writing this entirely from my Android phone! I spent quite a few hours trying to figure out how to get a clone of my git repository on here and hit a lot of dead ends. I tried multiple sets of instructions for AIDE and mGit with no success. Finally I found the Termux app which actually supports everything I need! For some reason Termux was not coming up in any of my searches for git clients on Android.
-
I can now push to my site from my phone via rsync! I added my Termux install’s ssh pub key to my nearlyfreespeech.net account. I wrote a one line script to make the rsync call that Guillermo Garron describes on his blog:
rsync -v -rzz --checksum --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r --delete <path-to-site>/ <user>@<server>:/<path> I had to install rsync via the following command:
pkg install rsync The -z compression option Garron recommends doesn’t work in Termux but switching to -zz (as the command’s own warning states) does work.
-
I started setting up Hugo to run my site. Hopefully this will decrease the friction for blogging and I’ll start writing more, but I make no promises.
So far Hugo seems to be a pretty straight forward site generator. After developing Adobe Experience Manager customizations professionally for 5 years this feels nice and simple. When I was picking between the various blogging platforms I had a number of criteria:
Minimal Set Up Full Control Over Design and Markup Minimal Cost (this quickly led me to static site generators) Markdown support Full Control over site structure I also looked at IndieWeb support.