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

use relative link for languages #489

Closed
wants to merge 1 commit into from
Closed

Conversation

milahu
Copy link

@milahu milahu commented Sep 26, 2022

cherrypick from 2fd53c0

@alex-shpak
Copy link
Owner

Hello!
Does this change fix some problem?

@milahu
Copy link
Author

milahu commented Dec 5, 2023

1 year later...

i guess this makes it work with github pages
where / is not the main path

@leoheitmannruiz
Copy link
Contributor

What I've seen a few times is people serving their site at both www.example.org and example.org (not redirecting one to the other).

Then, if the link is absolute (for example www.example.org/page) and you're on example.org (no www), you're suddenly on www.exampe.org.

I suppose that is an example for why relative links are good practice?

I might be missing the benefits of absolute urls though :)

@alex-shpak
Copy link
Owner

Long time again :D
Originally I had set .Permalink in order to support multi-lang sites on multihost:
https://gohugo.io/content-management/multilingual/#configure-multilingual-multihost

I will check, perhaps there is a way to verify if multi-lang was configured for multihost

@alex-shpak
Copy link
Owner

I pushed a change with
{{ cond hugo.IsMultihost .Permalink .RelPermalink }}
so that it will switch between Permalink and RelPermalink depending on if site is multiHost
Should fix this problem

@milahu
Copy link
Author

milahu commented Oct 2, 2024

good enough, i guess : )

@milahu milahu closed this Oct 2, 2024
Hanekihyouka pushed a commit to Hanekihyouka/hugo-book that referenced this pull request Oct 11, 2024
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 this pull request may close these issues.

3 participants