How to add custom javascript to Hugo
Chris Connelly
Posted on September 30, 2020
Add the following to your config.toml
custom_js = ["js/custom.js"]
in your head.html
{{ range .Site.Params.custom_js -}}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- end }}
Under static -->js
save your custom.js file!
Rebuild
💖 💪 🙅 🚩
Chris Connelly
Posted on September 30, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
hugo How To Event Stream Data From Your Hugo Site To Google Analytics Using RudderStack
January 20, 2022