matcornic / hugo-theme-learn

Porting Grav Learn theme to Hugo
https://learn.netlify.com/en/
MIT License
1.61k stars 1.28k forks source link

Logo image and Home button breaks for baseURL with subpaths (redirects to wrong address) when `landingPageURL` is present and MultiLingual mode isn't supported #463

Closed DamianSkrzypczak closed 4 years ago

DamianSkrzypczak commented 4 years ago

Breaking behavior:

When baseURL contains subpath, landingPageURL is defined but there is no support for multiple languages both logo and Home button redirects to "/" which will not match baseURL when it contains subpaths

More details:

Because .Site.IsMultiLingual variable is requirement for home button to use .Site.Params.landingPageURL

https://github.com/matcornic/hugo-theme-learn/blob/master/layouts/partials/menu.html#L17 https://github.com/matcornic/hugo-theme-learn/blob/master/layouts/partials/logo.html#L1

It's not possible change landingPageURL without defining multiple languages (adding section for single language doesn't work either). Fallback value is hardcoded as "/" for both, button and logo URLs.

Proposed solutions:

DamianSkrzypczak commented 4 years ago

I had this error probably due to lack of canonifyurls = true