Initial commit

Posted on Jun 2, 2019

Blog efficently - workflow for writing in public with ease.


My requirements are:

  1. Control the whole process from the command line
  2. Write in markdown
  3. No server management
  4. Custom domain name

Requirements 1-3 are easily satisfied by hugo.

Hugo supports rendering on github pages:

CLI deployment

Quoted from

  • Create a (e.g. blog) repository on GitHub. This repository will contain Hugo’s content and other source files.
  • Create a GitHub repository. This is the repository that will contain the fully rendered version of your Hugo website.
  • git clone && cd

Make your website work locally (hugo server or hugo server -t ) and open your browser to http://localhost:1313. Once you are happy with the results: Press Ctrl+C to kill the server

  • rm -rf public to completely remove the public directory
  • git submodule add -b master<USERNAME>/<USERNAME> public. This creates a git submodule. Now when you run the hugo command to build your site to public, the created public directory will have a different remote origin (i.e. hosted GitHub repository).

DNS Setup

The workflow

hugo new posts/

In a background terminal or tmux pane, start the hugo local server process:
hugo server -D
Now open http://localhost:1313 for a preview of the blog.

I do my editing with vim, and one of the best things with Markdown is not having to flip back and forth between the browser and the text editor, except when checking image layout and the like.