Jake Trent

Add Client-side Code Highlighting to Your Blog

There are a few options for client-side code highlighting. Highlight.js is one of the most popular, and it’s super easy to integrate into your site. Let’s do it! Compared to Server Side I usually default to server-side code highlighting. It puts the complexity of code highlighting in the build phase and keeps the runtime simple. The most popular server-side option is pygments. I have used this for many years. Unfortunately, in my latest conversion to hugo, I realized that the support for server-side highlighting was not good.

Read more

Convert a Database to Markdown

Once you get a bunch of data that you want to put on your site, it’s common to reach for a database. Then you’ll write an app that consumes that database and renders a dynamic site. What if, instead, you could create a static site from that data. What would that buy you? Dynamic Database If you have a dynamic site backed by a database (eg, postgres), you’ll have some good and some bad.

Read more

Continuous Delivery of a Static Site

Continuous delivery allows for you to release often what you are always developing. This is even possible on a static site where we might not be hiding in-development features but content and visual styles. Here is a strategy for doing that, executing in Hugo. Feature Toggles Main line development is a joy. It’s often good to avoid the long-lived, meandering paths of feature branches. In order to stay in the master branch, you need to keep it always ready to deploy.

Read more

Conversion from Octopress to Hugo

Several weeks ago, I decided it was time for me to move on from Octopress. It’s given me a good run. But there were a couple of causes that pushed me over the edge. My experience has been good with a few pains in the conversion. Outgrowing Octopress The most fundamental and important reason for me converting from Octopress is that it was getting slow to build my site. I’d write an article, run rake generate, and it’d take (anecdotally) 45 seconds.

Read more

Deploy create-react-app to Heroku on Node.js

Create-react-app is Facebook’s no-config solution to starting a React project. This setup does not support a server out of the box. You can create that easily enough. Node.js can be a good choice for your app server. Once it’s made and functioning, you might want to deploy your static app and app server. Here’s a few tips on getting them up onto Heroku.

Read more

DateTime in F#

I’ve said jokingly, when coding through date/time-related problems, someone could do a PhD on this stuff. Surely they have. It can get complicated. Here are a few core facts related to Utc time and the usage of .Net’s System.DateTime and System.DateTimeOffset classes that you may find useful.

Read more

Debug.log in Elm Pipes

There aren’t many functions in the standard lib for elm that create side effects. Elm’s Debug.log is one of those exceptions. It logs to the console. Here’s how it’s setup to make console logging whilst piping easier that patting your head whilst rubbing your tummy.

Read more

Handle Errors in a Node App

As with any software, here you can expect the unexpected. Node apps experience errors as well. Let’s say that an error crops in our Node API – what should we do about it?

Read more
Older