chipzoller / hugo-clarity

A theme for Hugo based on VMware Clarity
Other
583 stars 268 forks source link

Logo/nav_brand should link to root url. #134

Closed bengtan closed 3 years ago

bengtan commented 3 years ago

Changes / fixes

Hi,

I undefine baseURL in my site as I prefer relative links. However, there is a bug which occurs when baseURL is undefined.

Pre-this-PR:

If baseURL is http://example.com, then {{ absLangURL "" }} produces http://example.com ... which is partially correct but works.

If baseURL is undefined, then {{ absLangURL "" }} produces an empty string (ie. '') ... which is incorrect. It just links back to the existing page instead of the root of the site.

Post-this-PR:

If baseURL is http://example.com, then {{ absLangURL "/" }} produces http://example.com/ ... which is more correct.

If baseURL is undefined, then {{ absLangURL "/" }} produces / ... which is correct.

Screenshots (if applicable)

Not applicable

Checklist

Ensure you have checked off the following before submitting your PR.

bengtan commented 3 years ago

Actually, nah, don't worry about this PR. If I define baseURL = "/" then it works for me and no change is needed.

chipzoller commented 3 years ago

Yes, defining baseUrl as / is usually a better practice anyhow, for a number of other reasons.