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.