DEV Community

Cover image for Streamlining my writing workflow
Alex Hyett
Alex Hyett

Posted on • Originally published at alexhyett.com on

Streamlining my writing workflow

One of the best aspects of being a developer is always being on the lookout for the little efficiencies. For the last couple of weeks I have been trying to come up with ways of making my writing more efficient.

I do all of my writing in Obsidian which I have been doing for a few years now. The general process is:

  1. Write the post in Obsidian.
  2. Copy the contents over to my blog repo in Visual Studio Code.
  3. Sort out the frontmatter for the document (e.g. date, permalink, title)
  4. Fix any links that are pointing to internal notes/blog posts.
  5. Upload any images that I have added.
  6. Create the pull request to schedule the post.

All this formatting and copying and pasting everywhere can add an extra 15–30 minutes to creating my post each week. That is definitely something I can improve.

One of the great things about Obsidian is all the plugins that are available, and there are a few I have been using recently that have helped a lot with my workflow.

  • LanguageTool Integration — I have been using LanguageTool for a few years now as an alternative to Grammarly. I particularly like that you can self-host your own server, so no data gets sent off of your computer.
  • Cloudinary Uploader — I am using Cloudinary to host the images for my website. With this plugin any images I paste into Obsidian get uploaded to my Cloudinary bucket.
  • Auto Link Title — When I paste links into my posts this plugin fetches the title for me which saves quite a lot of time.
  • Templater - Obsidian already supports templates but if you need to do anything more complicated then you need this plugin. I will cover a bit about the templates I use in a bit.
  • Shell Commands — Lastly I have put together some scripts to make sync everything and this lets you run them from inside Obsidian.

Something I have been wanting to do for a while is to put my notes on my website and cross-link them with my blog posts. So if I write about zettelkasten it will link to my note on the topic. To be able to do this I needed to move all my blog posts into Obsidian so that I could create links between them.

Sync Script #

The main issue with writing posts in Obsidian is that internal links work a little differently. A normal markdown link looks like this:

[link text](/notes/link-to-note/)
Enter fullscreen mode Exit fullscreen mode

Internal links in Obsidian are in double brackets with the option to have a different display text:

[[Note Title|link text]]
Enter fullscreen mode Exit fullscreen mode

To fix this I put together a script that goes through the following steps:

  1. Copies my blog posts to a _staging folder in my blog repository.
  2. Uses regex to find any Obsidian style links.
  3. For each link, search through all my markdown files and find the corresponding file with the same name.
  4. Read the permalink URL from the frontmatter of the file.
  5. Replace the link with the markdown equivalent.
  6. Copy the files from _staging to the main content on my website.

You can see the script here. It is a bit rough, but it works for my purposes.

This lets me write all my posts in Obsidian and use the internal linking features to find mentions of other posts and have them still work in Eleventy.

Once I have finished my post I can run this script using the Shell Commands plugin.

Templater #

To save time on creating the frontmatter I have templates set up whenever I write a new post. This adds things such as the created and updated dates and the permalink.

The frontmatter for all my posts look like this:

---
permalink: /<% tp.user.kebabCase(tp.file.title) %>/
title: <% tp.file.title %>
date: <% tp.date.now('YYYY-MM-DDTHH:mm:ss') %>
updated: <% tp.date.now('YYYY-MM-DDTHH:mm:ss') %>
tags:
---
Enter fullscreen mode Exit fullscreen mode

The permalink line references a user defined JavaScript function to convert the title into a URL friendly title replacing the spaces with underscores:

const kebabCase = str => str
    .match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
    .join('-')
    .toLowerCase();

module.exports = kebabCase;
Enter fullscreen mode Exit fullscreen mode

I am sure there are a few more things I can set up in the future to streamline things a little more. If you have any suggestions let me know.


❤️ Picks of the Week #

📝 ArticlePySkyWiFi: completely free, unbelievably stupid wi-fi on long-haul flights — Why pay for Wi-Fi on a flight when you can have free internet passed through a single text field on a website? This was a fun read.

📝 ArticleMicrodosing Creativity: How a Creative Practice Can Reduce Anxiety and Improve Well Being — “The opposite of anxiety isn’t calm, it’s creativity”. I find my biggest sense of calm when I am playing guitar or drawing. I really like the idea of switch drawing and I think my daughters might like it too.

📝 ArticleUse A Work Journal To Recover Focus Faster And Clarify Your Thoughts — If you find you are constantly getting interrupted then keeping a journal can be a good way to stay on track. As part of my Obsidian workflow I have a daily note which I write in each day. If I think of anything I add it as an idea to my daily note.

🛠️ ToolAffinity’s Adobe-rivaling creative suite is now free for six months — I am currently paying £10 a month for Photoshop and Lightroom, but I am not using them as much as I used to. I was looking at alternatives recently and everyone seemed to be recommending affinity. It is a single one off cost which is currently half price so works out considerably cheaper too.

📝 ArticleReverse Engineering TicketMaster's Rotating Barcodes — This was an interesting read. No matter how clever you think your system is someone will come along and find a way around it.

📝 ArticleEntering text in the terminal is complicated — I always get frustrated when I go to edit a command using the arrow keys and get presented with ^[[D^[[D^[[C^[[C^.

📝 ArticleUsing S3 as a container registry — I was surprised by the speed differences here. You would have thought that AWS would use S3 under the hood for ECR but apparently not. I bet this works out cheaper too.

🛠️ ToolWebVM - Linux virtualization in WebAssembly — This is really cool. I am quite sure of the use cases yet. Maybe as part of a Linux training course it could be useful.

📝 ArticleDVD Deals as Cost-Measuring Systems. I have yet to find a store where I can buy 10 DVDs for a £1. I still buy DVDs and Blu-rays, usually it is only for recent films that we have enjoyed but won't be available for a long time on streaming services. For example, the last DVD I bought was for Wonka. It still seems worth it if you know you are going to watch it more than once.


💬 Quote of the Week #

So often in life, people assume that there is a correct way of doing things, when in truth, we are more often simply saddled by norms, tradition, the way our parents did something, or societal expectations.

From Someday Is Today by Matthew Dicks.

Top comments (0)