Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with setting landingPageURL being reliant on languages #525

Open
amlwwalker opened this issue Jan 28, 2022 · 1 comment
Open

Issue with setting landingPageURL being reliant on languages #525

amlwwalker opened this issue Jan 28, 2022 · 1 comment

Comments

@amlwwalker
Copy link

amlwwalker commented Jan 28, 2022

If you want to serve Hugo using this theme on xyz.com/tutorials

then in config.toml you can set

baseURL = 'https://xyz.com/tutorials'

this will fix all the links between pages to use the /tutorials path as part of every URL

However this doesn't fix the "Home" or Icon links, which take you to the root of the domain (i.e xyz.com) rather than xyz.com/tutorials.

Looking at the code for these:

The logo has the link:

<a id="logo" href='{{ (cond (and (ne .Site.Params.landingPageURL nil) (.Site.IsMultiLingual)) .Site.Params.landingPageURL "/") }}'>

and the Home button has the link

<a class="padding" href='{{ (cond (and (ne .Site.Params.landingPageURL nil) (.Site.IsMultiLingual)) .Site.Params.landingPageURL "/") }}'>{{ safeHTML (cond (ne .Site.Params.landingPageName nil) .Site.Params.landingPageName "<i class='fas fa-home'></i> Home") }}</a>

in both cases then it suggests that setting the landingPageURL='/tutorials in config would be what is required however, and I think its a bug, this actually would only work if multiple languages are set, i.e to be able to specify a path on the Home/logo links you need multi language (IsMultiLingual) but you don't need multilanguage to update the base URL?

I think that there is a bug that means that the path/url for these is reliant on multi language and that shouldn't be a requirement?

Shouldn't the baseURL be the default (otherwise / ) for Home/Icon link?

@McShelby
Copy link

McShelby commented Mar 9, 2022

This was fixed by @helfper in the fork. Feel free to check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants