Initial commit
Blog efficently - workflow for writing in public with ease.
Setup
My requirements are:
- Control the whole process from the command line
- Write in markdown
- No server management
- Custom domain name
Requirements 1-3 are easily satisfied by hugo.
Hugo supports rendering on github pages: https://gohugo.io/hosting-and-deployment/hosting-on-github/
CLI deployment
Quoted from https://gohugo.io/hosting-and-deployment/hosting-on-github/
- Create a (e.g. blog) repository on GitHub. This repository will contain Hugo’s content and other source files.
- Create a .github.io 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 directorygit submodule add -b master git@github.com:<USERNAME>/<USERNAME>.github.io.git 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/intial-commit.md
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.