Bits By Me uses the blog uses the hugo static site generator. Publishing articles is easy; working with Jupyter notebooks that become embedded GitHub gists is slightly more involved.
- Go - I use
asdf
soasdf install golang latest
works for me. - Hugo -
brew install hugo
- Task -
go install github.com/go-task/task/v3/cmd/task@latest
&&asdf reshim
.
Write a new blog post by providing a TITLE
and calling the task blog
:
TITLE="some-factoid" task blog
...write write write...
git add .
git commit -m "my cool post"
git push origin master
You do the roughly the same thing for Today I Learned posts but you don't provide a TITLE
.
task today-i-learned
OR
task til
Each post is put into a folder like til/1971-01-01/
or blog/1971-01-01/awesome-title
with an index.md
file. This gives you a spot to drop post-specific content next to the post itself. For example, if you want an image for a post you can drop it in that folder and reference it in the post thus:
The blog itself is hosting on Render.com. Log in using my personal Google Account will give access to the Personal Blog dashboard.
The DNS configuration is in Google Domains, again accessible using my personal Google account.
To start a dev server which also published Draft content just run task
.
That starts the default
task, the dev server:
task
Look at the draft Tips post to see examples of how you can use various elements like diagrams, code, and tweets.
If you want to publish and put all the non-draft content into the public/
directory just type hugo
on its own.
Following this advice it's a good idea to squish PNG images down before adding to Git or the blog. I'm seeing results like a reduction from 480kb to 70kb.
One time:
brew install pngquant oxipng
Then use like so, passing in the name of a content directory containing PNGs to squish:
pngquant --quality 20-50 content/til/2021-03-31/*.png
oxipng -o 3 -i 0 --strip safe content/til/2021-03-31/*-fs8.png