sntshk
1
I am using hugo version v0.59.1 on Linux. I have hermit theme enable (pretty much latest I guess).
I tend to write a lot of code in my blog (I use code fences).
Most of them are source code, so there will be line numbers visible at the gutter.
And some code are output of the code. I use code fences for them as well. But I want no line numbers on them.
Where can I enable this setting from?
bep
2
Have you looked in the documentation? It should be in there.
sntshk
3
I went through this: https://gohugo.io/content-management/syntax-highlighting/
Looks like I have to do that on all of my code blocks? I can enable it globally?
bep
4
I found it right away using the search:
sntshk
5
I tried that prior to posting here. That is having no affect on the blocks.
bep
6
It works, which must mean that
- your Hugo version is too old or
- your configuration is wrong. Which is hard to guess without seeing it.
sntshk
7
I just figured out pygmentsOptions = "linenos=table"
is essential in the config.
bep
9
A comment on my 1) above: We reworked the highlighting config when we introduced Goldmark some time ago; old syntax still works, though.
sntshk
10
I figured out how to enable line numbers, but how do I override it?
```{linenos=false}
this isn’t working.
PS: I also figured out that installing Hugo from system repo lags too behind.
sntshk
11
Any idea on how to override?
bep
12
The above looks correct (from memory), which tells me that you probably run with an old Hugo version.
sntshk
13
It was a caching issue. I verified in incognito mode.
Thanks, Erik for your time.
1 Like