https://sebastiandedeyne.com/better-code-highlighting-in-hugo-with-torchlight/ https://sebastiandedeyne.com/tags/hugo/https://sebastiandedeyne.com/better-code-highlighting-in-hugo-with-torchlight/During my latest https://sebastiandedeyne.com/2022-redesign/, I replaced Hugo’s default code highlighting with https://torchlight.dev. In this post, I’ll explain how I set up Torchlight CLI for my Hugo site.

You throw blocks of code to Torchlight and they return them in a highlighted form.

// Your token from https://torchlight.dev token: process.env.TORCHLIGHT_TOKEN, // The Torchlight client caches highlighted code blocks.

highlight.output: This is where Torchlight CLI will store the highlighted HTML files, it’s empty so Torchlight will overwrite the input files.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners