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

Logo link duplicates when base URL contains path #44

Closed
Anaminus opened this issue Apr 28, 2022 · 1 comment · Fixed by #48
Closed

Logo link duplicates when base URL contains path #44

Anaminus opened this issue Apr 28, 2022 · 1 comment · Fixed by #48

Comments

@Anaminus
Copy link
Contributor

When the base URL of the website is configured with a path, the path portion of the logo's URL will be duplicated.

Reproduction:

  1. In config.toml, set the baseURL to "https://example.com/foo/bar".
  2. Start hugo serve.
  3. Navigate to http://localhost:1313/foo/bar/.
  4. Click on the logo.

The result is that the page incorrectly navigates to http://localhost:1313/foo/bar/foo/bar/ instead of http://localhost:1313/foo/bar/.

The problem occurs in layouts/partials/theme/logo.html, and is likely caused by passing the .Site.Home.RelPermalink variable to the relLangURL function. Because relLangURL will already include the root, it would appear to be sufficient to pass an empty string instead. For example:

{{"" | relLangURL}}
jgazeau added a commit that referenced this issue May 8, 2022
jgazeau added a commit that referenced this issue May 8, 2022
@jgazeau
Copy link
Owner

jgazeau commented May 8, 2022

Thanks @Anaminus and sorry for the delay,
Indeed, url is correct now. (Problem was also in 404.html).

jgazeau added a commit that referenced this issue May 8, 2022
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

Successfully merging a pull request may close this issue.

2 participants