Hugo Ananke highlight.pack.js

Esteemed,

I'm building the site https://prdm0.rbind.io/ using the Hugo Ananke theme. I'm looking to highlight the R code using the highlight.js library. The theme does not support this automatically.

I tried to follow these instructions to no avail. Has anyone using this theme succeeded?

I managed to solve it. Below the solution:

Add the code below at the top of the page-header.html file:

<link href="//cdn.bootcss.com/highlight.js/10.1.0/styles/default.min.css" rel="stylesheet">
<script src="//cdn.bootcss.com/highlight.js/10.1.0/highlight.min.js"></script>
<script src="//cdn.bootcss.com/highlight.js/10.1.0/languages/r.min.js"></script>
<script>
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
</script>

change default to the style of your choice and r change to the language of interest.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.