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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners