In this post we will see how to create and publish a blog using a smartphone, all the while flexing some serious tech chops.

Requirements:

  • a smartphone running Android
  • the Termux app with git and hugo installed (pkg install git hugo) and properly configured to access the local storage
  • a git client (Play store link) like the older but quite functional Forker app for easy graphical interactions with git (commit, push…): especially useful on the long run for a smoother publishing experience, but you may also exclusively use the command line for increased hacker-cred
  • a text editor: I strongly recommend MiXplorer (free on XDA Labs or support version in the Play Store), which provides editors suitable for both code and text and is an amazing file explorer all around; Markor is a good second choice
  • accounts on compatible git hosting and CDN deployment services (I’ll be using GitLab and Vercel): although the CDN part is optional, it provides some nice benefits and a smoother experience overall than e.g. GitHub/GitLab Pages
  • a mobile browser (I recommend Firefox for Android) and of course… Internet access 😁

Instructions:

  • create a new empty project on GitLab and clone it in Termux/Forker (tip: use the HTTPS URL in Termux to avoid having to install and setup openssh)
  • in Termux, cd to the repo folder (~/storage/shared/Android/data/ch.phcoder.jigit/files/repo/*name* if using Forker) and run hugo create site . -f in it
  • follow Hugo Quick Start Guide to add a theme and some content to your site
  • check that everything is working as intended by running hugo server -D and opening http://localhost:1313 in your browser
  • then commit and push your site to GitLab through Termux/Forker
  • now follow the official Vercel guide for deploying a Hugo site
  • finally, enjoy your new blog created on your smartphone and available worldwide! 👍

Going further:

Now whenever you want to add some content to your blog, just create a new post in the proper folder either using hugo new posts/post_title in Termux or directly via your text editor, commit and push your changes and your updated site will be automagically deployed. You are officially equipped to blog on the go while roaming the vast world! Great success✌