I have a problem with my theme’s demo site on Hugo Themes.
Theme repository: Minimo
Template
I have this snippet in my theme:
<!-- Hugo Template -->
<script>window.__public_path__='{{- "assets/js/" | relURL -}}'</script>
Rendered Result
It generates (on the Hugo Themes demo site):
<!-- Rendered HTML -->
<script>window.__public_path__='\/assets\/js\/'</script>
Expected Result
But, it was expected to render:
<!-- Expected HTML -->
<script>window.__public_path__='\/theme\/minimo\/assets\/js\/'</script>
Because, Hugo Themes demo site’s URL is https://themes.gohugo.io/theme/minimo/
.
So, the relURL
result should start with /theme/minimo/
.
Additional Information (build result on local machine)
with (-b https://themes.gohugoio.com/theme/minimo
)
git clone --depth 1 https://github.com/MunifTanjim/minimo
cd minimo
hugo --source=exampleSite --themesDir=../.. -b https://themes.gohugoio.com/theme/minimo
cat exampleSite/public/index.html | grep __public_path__
Outputs:
</div><script>window.__public_path__='\/theme\/minimo\/assets\/js\/'</script>
with (-b https://themes.gohugoio.com
)
git clone --depth 1 https://github.com/MunifTanjim/minimo
cd minimo
hugo --source=exampleSite --themesDir=../.. -b https://themes.gohugoio.com
cat exampleSite/public/index.html | grep __public_path__
Outputs:
</div><script>window.__public_path__='\/assets\/js\/'</script>
Questions
What am I missing? I’ve been thinking about this problem for long and can’t seem figure it out.
Is there something wrong on my end?
Or is there something wrong with the Hugo Theme’s build process?