23-04 / This week in Dev

· [Daniel Baker]

Figure 1: Photo by Andrew Neel on Unsplash

Figure 1: Photo by Andrew Neel on Unsplash

Hi everyone, Dan here. Here’s my first weekly dev log that I plan to post. Hope you enjoy reading about what I’ve been up to this week.

Added markdown support in Kindle Clip

Refactored a bit how the code works. It’s now possible to setup a template in the directory of the repository and select it from the command line. As a first implementation I added mardown support, you can check that here. Eventually I’ll make kindle clip an npm package, maybe even an executable. It’ll come bundled with some templates but you’ll also be able to set a local directory to supply your own custom templates.

Started learning Svelte

Every now and again I take some time to dig into some new tech I haven’t tried before. Previous examples include nextjs and gatsby. Now I’m taking the time to learn Svelte, it’s similar enough to React that I’m able to pick it up quickly, but also different enough that I’m able to look at things in a different light. It’s refreshing to see a different approach to the way I’ve been doing things recently.

I’m still not sold on having the server functions in the same place as the UI code. I’m still concerned that if I wanted to move the front end to a new tech stack it would be easier with the MFE and BFF approach, but if both the backend and the front end is tied to the svelte package then they inevitably become harder to break apart.

Analytics into Google Sheets

Not wanting to use Google Analytics and still wanting to understand how people are visiting my site left me in a bit of a predicament. I don’t have the budget, or the need, to use something like fathom. And at this point in time I’m really only interested in the most viewed posts. Previously I wrote an edge function in Netlify that would send a page view hit to a google sheet. This worked fine, but the edge function added some delay to the loading of the pages. I decided to rewrite the call as a go function and call it form a deferred script on my page views. This works much better and doesn’t delay page loading. At some point I’ll share the code and sheet for that, but at the moment it’s still a bit rough around the edges.

Next week

I’m looking to add AI to my kindle import script. I’ll also look into setting up a sqlite database to keep track of the imports and which IDs are marked as duplicates. Though this maybe a little tricker from the command line. On top of that I wanted to finally release another project I’ve been working on. However I need to spend some serious time on it before it’s ready for release. The setup isn’t straight forward and I want to work on documenting that first before releasing it.

Thanks for reading. Reach out on twitter if you want to dig deeper into any of these topics! I’d love to chat about them :)