cocoa-eh-hugo-theme icon indicating copy to clipboard operation
cocoa-eh-hugo-theme copied to clipboard

Fix syntax highlighting issues with Chroma

Open salvalcantara opened this issue 5 years ago • 0 comments

Minor changes along the lines of https://themes.gohugo.io/beautifulhugo/ for supporting both highlight.js (theme-default) and chroma (hugo-native) highlighting solutions:

  • To use highlightling.js, use these settings within config.toml:
pygmentsCodeFences = false
pygmentsUseClasses = false

[params]
highlightjs = true
  • To rely on Chroma instead:
pygmentsCodeFences = true
pygmentsUseClasses = true

[params]
highlightjs = false

Using the new server side syntax highilighting provided by Chroma requires generating an additional CSS file. For example, for styling according to the trac theme, one would run:

hugo gen chromastyles --style=trac > static/css/syntax.css
  • The main.css file has been changed to properly display the horizontal scrollbar in code fences when using Chroma for syntax highlighting.
  • The README has been updated to point to the contributing guidelines.

salvalcantara avatar Jan 04 '20 12:01 salvalcantara