Closed vinaygaba closed 4 years ago
Syntax highlighting is working fine on our demo: https://hugo-novela-forestry.netlify.app/post/2019-04-31-understanding-the-gatsby-lifecycle/
This theme is using Prism to highlight code.
@DirtyF That is strange :( Does it require me to set any flags in my yaml file? Do I have to do anything special in the post? I can't find the code for the page you linked in the exampleSite
folder.
You don't need to, as it's using a JS library and not Hugo options. You need to add triple fenced codeblock with the name of the language you want to highlight: https://raw.githubusercontent.com/forestryio/novela-hugo-starter/master/content/post/2019-04-31-understanding-the-gatsby-lifecycle.md
@DirtyF So I copy pasted the code from this example and this works fine. But when I change the programming language to java
it doesn't. That's the language I was using it with. Seems to be a problem with that. You can try it with this code
ArrayMap<String, String> arrayMap = new ArrayMap<String, String>();
arrayMap.put("key", "value");
String value = arrayMap.get("key");
Seems like only the languages listed in this comment are currently working - https://github.com/forestryio/hugo-theme-novela/blob/811b4ca4ebef064f7e016ea589175cccdd75cbab/assets/css/prism.css#L2
@vinaygaba Thanks for the feedback, adding those files in your repository to customize what prism version you need seems the best way to go here.
Seems reasonable! Thanks!
I've tried a bunch of stuff that I read in different forums but none seem to work for me. I've included this in my config.yaml file
This is what the code in the blog looks like when I try to either use backticks with language or make use of hugu's highlight block.