Skip to content

Conversation

@ennru
Copy link
Contributor

@ennru ennru commented 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
Blog: Google’s Algorithms Can Ignore Rel Canonical When URLs Contain Different Content.

Fixes scala/bug#10640

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
@scala-jenkins scala-jenkins added this to the 2.13.1 milestone Mar 8, 2019
Copy link
Contributor

@adriaanm adriaanm left a comment

Choose a reason for hiding this comment

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

LGTM -- one question

val canonicalLink = if (canonicalSetting.isSetByUser) {
val canonicalUrl =
if (canonicalSetting.value.endsWith("/")) canonicalSetting.value
else canonicalSetting.value + "/"
Copy link
Contributor

Choose a reason for hiding this comment

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

is this normalization to end with a "/" always desired?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@diesalbla diesalbla added the tool:scaladoc Changes to Scaladoc, the API documentation generator label Mar 17, 2019
@diesalbla
Copy link
Contributor

@ennru Is this one ready to go? Can it be backported to 2.12.x?

@ennru
Copy link
Contributor Author

ennru commented Apr 14, 2019

Yes, this is ready to be merged. If there are not other comments.
I'm not sure if back-porting is OK, as it won't be part of 2.13.0 as far as I understand.

@adriaanm adriaanm modified the milestones: 2.13.1, 2.13.0-RC2 Apr 24, 2019
@adriaanm
Copy link
Contributor

Sorry about the delay, this is fine to merge for the RC cycle.

@adriaanm adriaanm merged commit 7bc330c into scala:2.13.x Apr 24, 2019
@ennru ennru deleted the canonical-urls branch April 25, 2019 07:23
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes worth highlighting in next release notes tool:scaladoc Changes to Scaladoc, the API documentation generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add canonical URL tag to scala API doc pages

5 participants