Whats the best way to load a script from markdown? I have a JS file that is only relevant for one blog post and therefore i’ve tried adding it using a script tag like so.
<script src="/js/testscript.js"></script>
However, unlike other HTML tags this is sanitized by the markdown processor. Is there a way to turn this behaviour off on a per-file basis?
thanks,
zach cp
Create a shortcode. They let you inject HTML content into your Markdown.
As it turns out, I observe the correct behavior only work machine. Perhaps there are different versions of hugo installed? In any event, adding raw html to markdown now works as expected, allowing me to add the tag directly.
Thank you rhewitt for your comment,
zach cp
Find hugo version with hugo -v
.
I’ve experienced some small differences as I bounce back and forth between OSX and Windows.