Using a baseurl without a trailing slash such as baseurl = "https://example.org" will generate invalid links in the HTML.
For example this baseurl will generate this incorrect url to the stylesheet href="https://example.orgcss/style.css".
This PR replaces the fragile .Site.BaseURL construction with the Hugo absURL function to generate urls. The documentation mentions trailing slash behaviour:
absURL and relURL are smart about missing slashes, but they will not add a closing slash to a URL if it is not present.
When you use netlify to host a hugo site netlify can create deploys for feature branches and pull requests. These specific deploys get an automatically generated url which you can access with environment variables such as DEPLOY_URL and feed into the hugo invocation. The environment variable values do not include a trailing slash so the site will break when using hugo-theme-bootstrap4-blog.
Using a baseurl without a trailing slash such as
baseurl = "https://example.org"
will generate invalid links in the HTML.For example this baseurl will generate this incorrect url to the stylesheet
href="https://example.orgcss/style.css"
.This PR replaces the fragile
.Site.BaseURL
construction with the Hugo absURL function to generate urls. The documentation mentions trailing slash behaviour:When you use netlify to host a hugo site netlify can create deploys for feature branches and pull requests. These specific deploys get an automatically generated url which you can access with environment variables such as
DEPLOY_URL
and feed into the hugo invocation. The environment variable values do not include a trailing slash so the site will break when using hugo-theme-bootstrap4-blog.