I hoping to be able to use the toha theme for my website, but syntax highlighting with styles from the gallery is not working correctly. The monokai theme looks fine but other styles are definitely not correct.
Since the author is too busy to fix all of the issues with this popular theme, is there a way I can track down the problem .css myself and try to fix it? Or else how can I use the markup.highlight.noClasses = false setting and use my own generated .css?
Here is the relevant part of my config.yaml for the site:
markup:
highlight:
style: github
noClasses: true
Here is what the syntax highlighting looks like with the github style:
Instead of using Hugo’s built-in syntax highlighter (chroma), the toha theme performs syntax highlighting via highlight.js. That means that the markup.highlight settings in your site configuration are irrelevant.
Either use a different theme, or override the following templates by copying them to your project’s layout directory (retain the relative path):
For the posts, it seems that the first one is relevant: layouts/_default/single.html.
However, as soon as I turn off the highlighting, extra space is added at the start messing up the code block. This is especially visible with line numbering on:
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
I noticed this is dependent on the Hugo version. Before I set the version in netlify.toml to match my local hugo, it was “less bad” but still not correctly rendered.