Inline code with syntax highlight

Hello,

I’m trying to see if I can use inline code with syntax highlight with gohugo. So I tried to use these two syntax:

`a = "abc"+"def"`{:.python}

and

`a = "abc"+"def"`{.python}

which seems to be used by Jekyll and Pandoc.

However, this does not work on gohugo (using the theme ananke), while the not-inlined version does work.

Thanks.

search helps

I don’t want to use shortcodes since it makes my document hugo-specific. I still want to be able to generate tex files from my source code, and inserting shortcodes would break that. I’ll try to see if I can use some other languages + pandoc.

You can’t use inline code with syntax highlight with gohugo. If you use shortcodes as suggested by @ju52 you can.