Skip to content

Version dropdown links on custom domain are wrong #247

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

Open
evetion opened this issue Apr 24, 2025 · 3 comments
Open

Version dropdown links on custom domain are wrong #247

evetion opened this issue Apr 24, 2025 · 3 comments

Comments

@evetion
Copy link

evetion commented Apr 24, 2025

It seems the version picker doesn't handle custom domains correctly, and always produces root/version links, instead of (in my case) root/repo.jl/version. Demo here: https://www.evetion.nl/GeoDataFrames.jl/dev/

The following code is used to generate the base url:

const getBaseRepository = () => {
  if (typeof window === 'undefined') return '';
  const { origin, pathname } = window.location;
  if (origin.includes('github.io')) {
    const pathParts = pathname.split('/').filter(Boolean);
    return `${origin}/${pathParts[0] ?? ''}`;
  }
  return origin;
};

It seems the function should remove improve the check for github.io.

@thofma
Copy link
Contributor

thofma commented Apr 24, 2025

Whatever will be changed, it should be checked to not break all of the working examples of the version picker with custom domains, e.g., https://lux.csail.mit.edu/stable/ or https://docs.hecke.thofma.com/stable/.

@evetion
Copy link
Author

evetion commented Apr 24, 2025

Certainly! The assumption seems to be that GitHub has a repo part, and custom domains don't (as in your examples). Maybe the deploy url should just be taken into account, instead of parsing the current window url.

edit: Although using deploy url broke the website for me 😅

@jkrumbiegel
Copy link
Collaborator

I have made some changes to this on my branch #246 because I wanted to check everything was working on my fork which automatically uses my account's domain. We could also pull those out of that PR to have things separated better.

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

3 participants