-
Notifications
You must be signed in to change notification settings - Fork 155
Description
When I deploy a branch preview on Netlify, the site using this theme does not look right because the CSS and JS resources from the theme are not found.
I believe this is because {{.Site.BaseURL}} is used, and it does not add missing trailing slash. I have one in my baseURL config but Netlify sets none when changing the base URL.
ghostwriter/layouts/partials/header.html
Lines 14 to 15 in 2dd435c
| <link rel="stylesheet" href="{{ .Site.BaseURL }}dist/site.css"> | |
| <link rel="stylesheet" href="{{ .Site.BaseURL }}dist/syntax.css"> |
However, it seems that loading resource this way is not advice. See gohugoio/hugo#3262 (comment) where the maintainer of hugo advice the following
But manually creating URLs using {{ .Site.BaseURL }} is fragile, esp. for themes, and not recommended. Use absURL and friends, and you should not have to worry about slashes.
Using relURL or absURL would be better I believe.
This fix the issue I encounter if I tweak the theme. But there are a lot of occurrences in the theme of this.
I think this should be fixed as the theme level.
Does this cause any issue with anyone in the past ?