xianmin / hugo-theme-jane

A readable & concise theme for Hugo
https://xianmin.github.io/hugo-theme-jane/
MIT License
918 stars 285 forks source link

rm leading slash for relURL #364

Closed p0n1 closed 9 months ago

p0n1 commented 1 year ago

Check https://gohugo.io/functions/relurl/#input-begins-with-a-slash for details.

If the input begins with a slash, the resulting URL will be incorrect when the baseURL includes a subdirectory. With a leading slash, the function returns a URL relative to the protocol+host section of the baseURL.

As a result, the customJS and customCSS feature was broken when baseURL includes a subdirectory like https://example.com/blog.

xianmin commented 9 months ago

@p0n1 Thanks for your PR!