Code block render hook not working when deploy to Netlify

Hello guys. Im following this document to setup my code block to show language highlights code using render hooks

# layouts/_default/_markup/render-codeblock.html
{{ $class := .Attributes.class | default ""    }}
{{ $lang  := .Attributes.lang  | default .Type }}
<!-- Show language label -->
<div class="code-label">
    Label <p>{{$lang}}</p>
{{ if transform.CanHighlight $lang }}
<div class="{{ $class }}">{{ highlight .Inner $lang }}</div>
<pre><code class="{{ $class }}">{{.Inner}}</code></pre>

The thing is. It work normally on localhost. But when i tried to deploy to Netlify, somehow the codeblock-render is stop working

Netlify deployed

My repo:

What happend guys? I need help

# My hugo version. 
# OS: Ubuntu 22.04 LTS
hugo v0.98.0-165d299cde259c8b801abadc6d3405a229e449f6+extended linux/amd64 BuildDate=2022-04-28T10:23:30Z VendorInfo=gohugoio

1 Like

The document im follow

NVM ! i totally forgot that i have to set specific version of Hugo to 0.92 in netlify.toml


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