If your GitHub Pages code uses the highlighter tag with an invalid language identifier, your GitHub Pages site will not build.

If your GitHub Pages site fails to build because you specify an invalid highlighter language, you'll get an email with this message:

Subject: Page build failed

The page build failed with the following error:

The highlighter language identifier `invalidlanguage` is invalid.

You will only receive an email if outbound email support is enabled on your Enterprise instance. For more information, contact your site administrator.

Troubleshooting invalid highlighter language errors

Tip: We strongly recommend running Jekyll locally so you can easily debug and fix build errors before pushing to your GitHub Enterprise instance. To learn more about troubleshooting options, see "Troubleshooting GitHub Pages builds."

  • Check the highlighter language identifier referenced in the build failure email. When using the highlight tag you must provide a valid language identifier as the argument. To find the valid identifier to use for the language you want to highlight, look for the “short name” of the language on the Pygments Lexers page.

Example

To highlight a Ruby code snippet, you would pass the value ruby as the argument to the highlight tag:

{% highlight ruby %}
def foo
  puts "foo"
end
{% endhighlight %}

Once you've fixed any invalid highlighter language identifiers, you will need to commit your changes and push to your GitHub Pages repository again to trigger another build on the server.

Further reading