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

tour: relative links don't work outside of /tour for offline tour #1463

Open
crisman opened this issue Mar 13, 2023 · 0 comments · May be fixed by golang/website#213
Open

tour: relative links don't work outside of /tour for offline tour #1463

crisman opened this issue Mar 13, 2023 · 0 comments · May be fixed by golang/website#213

Comments

@crisman
Copy link

crisman commented Mar 13, 2023

Context: https://go.dev/tour/moretypes/15

Lots of links in the tour using origin-relative links on the assumption they will be used at https://go.dev/, which works out badly if the tour is being used offline. For example we have the append documentation going to

http://127.0.0.1:3999/pkg/builtin/#append

rather than

https://go.dev/pkg/builtin/#append

Lots of pkg/ links, also /blog, /doc, /talks, /cmd, & / directly.

crisman added a commit to crisman/golang_website that referenced this issue Mar 13, 2023
Lots of links in the tour use origin-relative links on the assumption
they will be used at "https://go.dev/", which works out badly if the
tour is being used offline. Links inside of "#appengine:" don't need to
be updated as they will be running inside the normal location.  Also
don't have to update links starting with "/tour" as they will work in
the offline and appengine modes.

I did consider updating the links to the place they currently redirect
for links like "https://go.dev/pkg/builtin" which ends up at
"https://pkg.go.dev/builtin" but it is redirecting with 307 Temporary
Redirect (unlike the 301 Moved Permanently "https://golang.org/" gets) so I
avoided those updates.

Update origin-relative links that will appear offline to be absolute
https://go.dev links.

Fixes golang/tour#1463
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.

1 participant