A quick rundown of setting up a multi-device Hugo workflow, and accessing your static site files on three different systems (macOS, Android, Linux). I go through some practical tips, app recommendations, and config/commands to make cross-device blogging straightforward.
Multi-Device Blogging Workflow
I like and appreciate being able to access my Hugo blog from multiple devices. I mainly write on my Mac Mini; but have recently overhauled my Android workflow; plus I configured my less-used MacBook Air 13" (2012) running on Linux Mint to be able to access and deploy this site. Will try to keep this one short and sweet! 😉
Android Setup
Git Client
I originally used PuppyGit, and for a while, it wouldn’t work with SourceHut’s git repo SSH clone URL format git@git.sr.ht:~username/repo_name, so I switched to GitSync.1 But GitSync was failing on me quite often with syncs failing repeatedly in a loop—so I returned to PuppyGit happy to know the dev got SourceHut’s SSH sorted now!
Tip
Remember to add
author.nameandauthor.emailto your Git client and use SSH keys whenever possible.And when cloning, do a shallow clone to reduce the size of the repo by skipping the large commit history being downloaded onto your mobile device:
git clone --depth=1 <repository-url>
IDE
I have tried ACode and Squircle CE. They’re both good, see which suits your needs more! Working in an IDE means there’s syntax highlighting and other features like code-completion. One can use just a Markdown editor like Markor to write and edit blog posts.
Linux Setup
My second computer is running Linux Mint but it is barely used, so I had to start from scratch in terms of installing all the tools I use in my Hugo workflow. Here is a brief rundown of what I did to get it all working:
Create a new SSH key for this device and add the
.pubkey into https://meta.sr.ht/keys (or your hosted Git repo provider)git clonethe website source filesI have my Hugo theme installed as Git Submodules, so I have to run
git submodule update --init --recursiveto download the theme files, then rungit submodule update --remote --mergewhen I want to update the theme.Install
git,go, andhugo. I originally installed Hugo withaptbut the version was really out of date (like lower than v.0.100) and the site failed to build. So I recommend installing via Snap (I should have followed the Hugo Linux install instructions).Setup basic Git config:
1git config --global user.name "Name" 2git config --global user.email "name@example.com"`Try running
hugo serverand you should be able to work on your site!
IDE Setup
I’m using VSCodium on Linux as well, but I was unable to get zsh to run in the integrated terminal, it only ran sh, while in the Terminal outside VSCodium, which zsh works and shows the path. So here’s how I got it to work:
- Ensure
zshis installed on the system.
1sudo apt update
2sudo apt install zsh -y
3zsh --version
4which zsh # Shows a valid path, meaning it is installed correctly
5chsh -s $(which zsh) # Make it the default shellBecause I used Flatpak to install VSCodium, it is sandboxed and doesn’t have access to the system shells like /usr/bin/zsh. To overcome this I had to do some research and found this workaround:
Install a utility called
host-spawnto help bridge the sandboxed/isolated app to the host system shells1sudo apt install flatpak-xdg-utils 2flatpak override --user --filesystem=host com.vscodium.codiumAfter installing
host-spawn, go into VSCodium settings (.jsonmode) and set the shell profile to be:
1"terminal.integrated.profiles.linux": {
2 "zsh": {
3 "path": "/app/bin/host-spawn",
4 "args": ["zsh"],
5 "icon": "terminal-bash",
6 "overrideName": true
7 }
8},
9"terminal.integrated.defaultProfile.linux": "zsh"- Close and restart VSCodium to see the
zshrunning in the integrated terminal!
I really love Hugo and static sites in general. You might think this is very technical to set up, but once you get the hang of the basics of Git, Markdown, and using an IDE—I think you too, will take this over using something like the WordPress Web UI any day of the week!
Blog on.
I moved my Hugo blog source code from GitHub to sr.ht recently. ↩︎
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.