tldr:
Time to fiddle with my site setup some more.
My site posts are organized by file slug: simplified file paths based on a title. Hugo itself directly supports creating new content by path.
It takes thinking to map from a title to a slug. Sometimes I’m not in the mood for that kind of thinking. And I’m not always great about consistency in my slug choices.
So I use a Ruby script to streamline adding new posts. I won’t talk about that today. Maybe another day. All it does is use TTY::Toolkit to save me a couple seconds of thought compared to hugo new
, then fires up $EDITOR
for me so I don’t have to think about that either. Sometimes two seconds is the difference between writing an impulse post and writing a tweet.
Right now the script needs a --title
string it can use for frontmatter and file slug.
I don’t have to figure out the slug, but it’s still rather tedious. I use just to simplify those tedious site tasks. Putting the repeated bits of this invocation in a recipe — that’s what just
calls tasks — would cut down on the tedium. What about the title? Started thinking about TTY::Toolkit interactive prompts. Maybe some other time, because just
lets you specify arguments for a recipe.
Now I can just add
a post.
And here we are!
I use a couple other Ruby scripts. Might as well refactor that bundle exec ruby
.
All right. This is better than what I had before. Sure I’ve got multiple helpful layers to track now. That’ll bite me if I get carried away. On the other hand, I actually wrote something for the site today.
Sometimes two seconds makes the difference.
Backlinks
Got a comment? A question? More of a comment than a question?
Talk to me about this page on: mastodon
Added to vault 2024-01-15. Updated on 2024-01-26