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 canonical URL tag to scala API doc pages #10640

Closed
lajnakjjfn opened this issue Dec 3, 2017 · 4 comments · Fixed by scala/scala#7834
Closed

Add canonical URL tag to scala API doc pages #10640

lajnakjjfn opened this issue Dec 3, 2017 · 4 comments · Fixed by scala/scala#7834

Comments

@lajnakjjfn
Copy link

lajnakjjfn commented Dec 3, 2017

https://publicobject.com/2017/02/14/canonical-urls-for-javadocs/ reminded me that the described issue seems to also be present for the docs at http://www.scala-lang.org/api.

The issue being, when e.g. searching for 'scala bigint', Google shows links for the 2.7.4 and 2.12.0 API docs, but not for the 'current' version.

Would it make sense to insert canonical URL tags in the future API doc pages on scala-lang.org/api, or even retroactively in the existing versions?

@SethTisue
Copy link
Member

yes, I believe a pull request that added this would be welcome

but, it isn't obvious to me without doing a little research if this should be a change to the Scaladoc tool, or a change to https://github.com/scala/scala-dist, or what

applying the change retroactively would require running a script on the machine that serves scala-lang.org, but we could certainly do that too — if the pull request included such a script, which had been tested first locally, that would be super-awesome

ennru added a commit to ennru/scala that referenced this issue Mar 8, 2019
Introduces a new command line flag for Scaladoc to configure a base URL for generation of canonical URLs on all pages.
Canonical URLs intend to help search engines to identify the most relevant/recent version of a page when several versions are available.

References
[Google Support: Consolidate duplicate URLs](https://support.google.com/webmasters/answer/139066?hl=en)
[Blog: Google’s Algorithms Can Ignore Rel Canonical When URLs Contain Different Content.](https://www.gsqi.com/marketing-blog/google-ignore-rel-canonical-different-content/)

Fixes scala/bug#10640
@SethTisue SethTisue added this to the 2.13.0-RC2 milestone Apr 24, 2019
ennru added a commit to ennru/scala that referenced this issue Apr 25, 2019
Introduces a new command line flag for Scaladoc to configure a base URL for generation of canonical URLs on all pages.
Canonical URLs intend to help search engines to identify the most relevant/recent version of a page when several versions are available.

References
[Google Support: Consolidate duplicate URLs](https://support.google.com/webmasters/answer/139066?hl=en)
[Blog: Google’s Algorithms Can Ignore Rel Canonical When URLs Contain Different Content.](https://www.gsqi.com/marketing-blog/google-ignore-rel-canonical-different-content/)

Fixes scala/bug#10640
ennru added a commit to ennru/scala that referenced this issue Apr 25, 2019
Introduces a new command line flag for Scaladoc to configure a base URL for generation of canonical URLs on all pages.
Canonical URLs intend to help search engines to identify the most relevant/recent version of a page when several versions are available.

References
[Google Support: Consolidate duplicate URLs](https://support.google.com/webmasters/answer/139066?hl=en)
[Blog: Google’s Algorithms Can Ignore Rel Canonical When URLs Contain Different Content.](https://www.gsqi.com/marketing-blog/google-ignore-rel-canonical-different-content/)

Fixes scala/bug#10640
ennru added a commit to ennru/scala that referenced this issue Apr 25, 2019
Introduces a new command line flag for Scaladoc to configure a base URL for generation of canonical URLs on all pages.
Canonical URLs intend to help search engines to identify the most relevant/recent version of a page when several versions are available.

References
[Google Support: Consolidate duplicate URLs](https://support.google.com/webmasters/answer/139066?hl=en)
[Blog: Google’s Algorithms Can Ignore Rel Canonical When URLs Contain Different Content.](https://www.gsqi.com/marketing-blog/google-ignore-rel-canonical-different-content/)

Fixes scala/bug#10640
ennru added a commit to ennru/scala that referenced this issue Apr 27, 2019
Introduces a new command line flag for Scaladoc to configure a base URL for generation of canonical URLs on all pages.
Canonical URLs intend to help search engines to identify the most relevant/recent version of a page when several versions are available.

References
[Google Support: Consolidate duplicate URLs](https://support.google.com/webmasters/answer/139066?hl=en)
[Blog: Google’s Algorithms Can Ignore Rel Canonical When URLs Contain Different Content.](https://www.gsqi.com/marketing-blog/google-ignore-rel-canonical-different-content/)

Fixes scala/bug#10640
@mslinn
Copy link

mslinn commented Jul 10, 2019

Please consider this an actionable request for supporting the Scala-related educational community.

Most of the Scaladoc links in our 2 Scala courses broke with the Scala 2.13 release (~350 links in 110 lectures) because the URLs for method-level docs changed. This was not a problem for previous Scala releases. Canonical URLs would have prevented that, and could also provide a universally accepted shortening method so bazillion-character-long URLs would be no longer be generated.

Even though I wrote a script to generate SQL commands to update the transcript database, many URLs still need to be hand-tweaked.

@Jasper-M
Copy link

Most of the Scaladoc links in our 2 Scala courses broke with the Scala 2.13 release (~350 links in 110 lectures) because the URLs for method-level docs changed. This was not a problem for previous Scala releases. Canonical URLs would have prevented that

I'm not sure how you would maintain this across different Scala version (except manually for each class and method). The reason the urls changed is that classes changed packages and methods changed signatures.

Also note that although this issue is closed because scaladoc supports setting a canonical url, I don't think that the scaladoc of the standard library already contains canonical urls.

@mslinn
Copy link

mslinn commented Jul 24, 2019

I don't think I did a good job of explaining myself.

  • The autogenerated URLs are unwieldy, so a standard algorithm for shortening them would help
  • Several different URL generation mechanisms have been used over the years. I'm asking for a stable mechanism, which I called "canonical" per the link I provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants