Since refactoring my site back in 2023, authoring posts is pretty simple. But to make it even easier, I wrote a little helper script. When I run node tools/new from my project directory, the script… Greets me with some friendly kaomoji Asks for the post title Generates a URL/filename slug from said title, which I can tweak Checks out a Git branch (where necessary), using a name I can also tweak Creates a Markdown file in the right spot with the title and current date/time in the front matter Offers to open the result in my editor Here’s how it looks in action: It takes fewer than 200 lines of handwritten code, adds no new dependencies to my project, removes some inertia from the writing process and does so with a smile. Let me show you how it works! Disclaimer This script has a user base of (checks notes) one person. It is very specific and opinionated: I have used it in macOS, Linux Mint, and Windows via WSL/Ubuntu only. It may require Node.js 24 or later (I’m not exactly sure,…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.