Posts tagged 'blogging'

Making it easier to blog

published on January 03, 2020.

2019 was a not so great year for my blogging. 7 posts in total. There are multiple reasons for that, all the regular stuff like “I didn’t find the time” and “Nothing to blog about”.

Currently I’m reading Atomic habits (great book by the way, do read it if you haven’t!), and one of the suggestions for starting a new habit is to make it easy to do it. So, here we are.

This blog is powered by a static web site generator, Hugo, I write the posts in plain ol’ markdown files, and use (g)vim as the editor. I even created a vim plugin to speed some things up with Hugo. Once a new post is written, I use fabric to build and deploy the site to my server. Pretty easy.

After giving it a bit more thought, there are still some steps in this entire process that I can speed up with a few more vim helpers, and a couple of bash functions.

bash

I wrote four little bash functions to make my blogging even easier than before:

The blog function takes me to directory where I keep my blog, starts Hugo’s server in the background, waits a bit so that the site is up, and opens up my local blog in Firefox. Given that it’s a bash function, I can create a custom action in XFCE’s Application finder.

~/.bashrc
function blog() {
    cd "/home/robert/projects/robertbasic.com-hugo/"
    hugo server &> blog.log &
    sleep 3s
    firefox http://localhost:1313/blog/
}

blog-stop stops the hugo server and cleans up.

~/.bashrc
function blog-stop() {
    cd "/home/robert/projects/robertbasic.com-hugo/"
    pkill hugo
    rm blog.log
}

blog-new creates a new blog post and opens it up in gvim.

~/.bashrc
function blog-new() {
    hugo new blog/$1.md
    gvim content/blog/$1.md
}

blog-drafts lists all the drafts I currently have. They tend to pile up after a while.

~/.bashrc
function blog-drafts() {
    ag -l "^draft = true" content
}

vim

As for vim, I have the vim-hugo-helper plugin, and one custom vim function that I call on a new post:

~/.vimrc
command! BlogWrite call BlogWrite()
function! BlogWrite()
    call HugoHelperFrontMatterReorder()
    HugoHelperTitleToSlug
    HugoHelperTitleCase
    HugoHelperSpellCheck
endfun

It calls the four Hugo helper functions that I used to call manually every time.

There’s still room for improvement, but this will do for now. I also want to figure out a way to blog from my phone, I have a few ideas for that as well. Need to test them out and see what works best.

Happy hackin’!

Tags: blogging, hugo, vim, helpers.
Categories: Blablabla.

Everybody knows that

published on May 08, 2017.

Back in December last year, Matthew Turland published a blog post asking “Why aren’t you speaking?

It made me think.

What I realised is that I always havehad this feeling that everybody already knows what I know.

Is that part of an impostor syndrome?

I don’t know. I really don’t feel like an impostor. I know what I know, I’m perfectly fine accepting that I don’t know everything… but then there’s this feeling that everybody else knows what I know. It’s a strange feeling, I’m not even sure if I can explain it properly.

This also led me to realise why I don’t blog more often. I like blogging. I like writing. I don’t consider myself being a good writer, but with English being my third language, mostly self-taught, I think I do quite alright.

It’s the same thing as with me not speaking at a conference or a user group — everybody knows that.

After doing some more thinking on this subject, there’s only one logical result — it is not possible for everyone to know what I already know. It’s just not possible.

I have learned, and still am learning from other people, by either reading their blogs, or hearing them talk, or looking at their answers on StackOverflow, or digging through their code on GitHub… Surely there are others out there that can learn a thing or two from me.

I also “agreed” with myself that not every blog post needs to be an essay, that it’s OK to publish a couple of short paragraphs, quickly writing down the things going around in my mind.

With those thoughts, with that kind of a mindset, I set out to start blogging again. Since December, since Matthew’s post, I blogged 20 times. I don’t think I have written so many posts in the past 4 years.

Oh, and I gave a talk at two different occasions as well.

Thanks Matthew.

Tags: about, blogging, blog.
Categories: Blablabla.
Robert Basic

Robert Basic

Software developer making web applications better.

Let's work together!

I would like to help you make your web application better.

Robert Basic © 2008 — 2020
Get the feed