Hugo site syntax highlighting working locally but not through Netlify

I built a static site through Hugo. Site looks different through Netlify as compared to running it locally. A specific example is syntax highlighting for YAML. In the code I do the following:

- name: Getting started
  hosts: iosxe
  gather_facts: no

  gather_subset: hardware

So I’m “tagging” my snippet as a YAML snippet.

When I run hugo locally:
Screenshot 2020-05-05 at 08.41.08

As a new user I can only add one image in my post here, so please have a look at the first snippet on this page to see how it looks like when it’s deployed through Netlify.

To have the syntax highlighting, I have added in the config.toml file the following (as per the Hugo documentation):

pygmentsCodefences = true 
pygmentsStyle = "arduino"

So I would indeed expect the Netlify hugo build command to look at that setting and apply it. But it looks like this is not happening (only for yaml as it seems)

The strange thing with all this, is that the syntax highlighting works for Python code (both locally and via Netlify).

Is this something YAML specific? Am I not setting it correctly?

hi there, could you maybe share a screenshot of what you are expecting it to look like vs what it actually looks like? thanks.

Sorry for the late reply. As a new user I could not upload two images in that post so I have done it through imgur. See here. First one is as it looks when deploying the site through Netlify. Second images is when I run the site locally through ‘hugo server -D’.

I would want the colour highlighting to work through Netlify as well. Note: this only seems to be the case for YAML files. Here is an example for Python. As you can see, this works same on both Netlify as localhost.

Hey @wiwa1978, are you still running into this? When I visit, i.e.,, the YAML looks correctly highlighted… let us know! :slight_smile: