Why the templates rendered incorrectly?I am rookie to Golang and Hugo, should I learn Go template first?

{{< blocks/section height="full" color="dark" >}}
  <div id="root"></div>
  {{ $jsbundle := "http://localhost:1314/bundle.js" }}
  {{ if not .Site.IsServer}}
  {{ $jsbundle := (index .Site.Data.manifest "main.js") }}
  {{ end }} 
  <script src="{{ $jsbundle }}" type="module"></script> -
{{< /blocks/section >}}

I use the docsy for theme, the blocks/section is the predefined shortcode, and rendered correctly.
Below is what rendered in browser.

Go template tags can only be used in templates not in content files like you are trying to do.

But, is the {{< blocks/section height="full" color="dark" >}} also the Go template tags ?I am confused. so where should I put the code in that this file can get $jsbundle. could you show me some examples. Many thanks!!!

Should have added a note regarding “Shortcodes”. They are a Hugo thing that allow you to add template snippets into content. Very useful indeed.

Looking at the docsy theme I would most likely override this file:

and add my own javascript to that file.

I read the Customizing templates doc. If i put the code in layouts/partials/body-end.html, they will affect every page, that rigtht? what i want is just mout that js file in the “playground” page. Any idea? :thinking: