HUGO
Access template variables in JS
support
frjo
June 11, 2022, 7:54am
3
You can make use of “ExecuteAsTemplate”.
I do this in my Zen theme in a couple of places.
2 Likes
Variables inside JavaScript
show post in topic
Related topics
Topic
Replies
Views
Activity
{{.Site.BaseURL}} appears in a JS template literal
support
4
610
October 16, 2023
Accessing hugo's template variable inside Javascript files?
support
12
8468
April 7, 2023
Access JS variables across in partials and html pages
support
1
933
June 10, 2020
Is it possible to access HTML values or JS variables from Hugo templates?
support
3
1088
April 24, 2019
Templating JS?
support
12
3840
June 4, 2020