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

Add a langauge-based js redirect to the homepage #60

Closed
wants to merge 3 commits into from

Conversation

SThomasP
Copy link
Contributor

Fixes #47

Tested with firefox 112.0.1 and hugo 0.123.0. I'll test with other browers if the preview builds correctly.

I may add something for browsers that don't support navigator.langauges, but according to MDN all modern browsers do

@xhain-ci
Copy link

xhain-ci commented Feb 19, 2024

Deployment of preview was successful: https://xHain-hackspace-xhain-website-pr-60.surge.sh

Copy link

@jdwillemse jdwillemse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in Safari and Chrome and the solution works.

Client-side redirects are seen as a performance villain and running this through page speed insights makes it complain. I think we really need a backend solution. https://pagespeed.web.dev/analysis/https-xhain-hackspace-xhain-website-pr-60-surge-sh/v6kzhi8trb

layouts/alias.html Outdated Show resolved Hide resolved
layouts/alias.html Outdated Show resolved Hide resolved
layouts/alias.html Outdated Show resolved Hide resolved
@pantierra
Copy link
Collaborator

Thanks for the work already. I'd also clearly prefer a server-side solution. Have you reached out and talked to @gueldenstone already?

@SThomasP
Copy link
Contributor Author

SThomasP commented Feb 20, 2024

Server-side would obviously be better, but without access to the hosting, this is the best I can do.

@gueldenstone
Copy link
Member

Hi please let me know which headers are missing to make this work! You can check the traefik config here
and here

@SThomasP
Copy link
Contributor Author

Closed as the preference is for a server-side solution.

@SThomasP SThomasP closed this Mar 14, 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.

Switch language based on user preferences
5 participants