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

x/website, x/blog: rewrite relative links as absolute when embedding a blog post #36944

Open
dmitshur opened this issue Jan 31, 2020 · 1 comment
Open

Comments

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Jan 31, 2020

Most blog posts use absolute links when pointing to other blog posts or pages on blog.golang.org, but there are some that use relative links, and blog post authors may pick one or the other. When reading blog posts at https://blog.golang.org, both work.

Relative links become broken when embedded directly on the golang.org website, because they start being relative to golang.org rather than the intended blog.golang.org domain.

See #36930 where this happened.

Either the website should rewrite relative links so they are not broken, or if that is too disruptive, then a test should be added that would catch when blog post authors use relative links.

@gopherbot
Copy link

@gopherbot gopherbot commented Jan 31, 2020

Change https://golang.org/cl/217239 mentions this issue: content/go1.15-proposals.article: revert "use relative links for other blog articles"

gopherbot pushed a commit to golang/blog that referenced this issue Jan 31, 2020
…r blog articles"

This reverts CL 216626 (commit 8bf1296).

We cannot rely on relative links in blog posts to stay relative to
blog.golang.org, because blog posts are also embedded on golang.org.
This change caused those links to point to
https://golang.org/go2-here-we-come, which is 404.

Fixes golang/go#36930
Updates golang/go#36944

Change-Id: Ie5ca8f112ff6465328d258b283d540c07e909a54
Reviewed-on: https://go-review.googlesource.com/c/blog/+/217239
Reviewed-by: Robert Griesemer <gri@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.