Krinkle has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/223265

Change subject: OutputPage: Don't set <link hreflang=x-default> on all pages
......................................................................

OutputPage: Don't set <link hreflang=x-default> on all pages

Follows-up 91d8a51825.

Having the default variant advertised seems useful, however for
wikis and/or pages that have no variants or translated versions,
outputting this header doesn't seem useful.

https://support.google.com/webmasters/answer/189077 doesn't
justify sending it unconditionally.

To try out, setting $wgLanguageCode = 'zh'; will result in all
pages having hreflang=x-default and all variants. And setting to
'en' or 'de' will result in none of those link tags.

Change-Id: I21cd072534ae1df960209e657b19c96889ece27c
---
M includes/OutputPage.php
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/65/223265/1

diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 0ed847e..30ee19c 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -3440,12 +3440,12 @@
                                                'href' => 
$this->getTitle()->getLocalURL( array( 'variant' => $_v ) ) )
                                        );
                                }
+                               # x-default link per 
https://support.google.com/webmasters/answer/189077?hl=en
+                               $tags["variant-x-default"] = Html::element( 
'link', array(
+                                       'rel' => 'alternate',
+                                       'hreflang' => 'x-default',
+                                       'href' => 
$this->getTitle()->getLocalURL() ) );
                        }
-                       # x-default link per 
https://support.google.com/webmasters/answer/189077?hl=en
-                       $tags["variant-x-default"] = Html::element( 'link', 
array(
-                               'rel' => 'alternate',
-                               'hreflang' => 'x-default',
-                               'href' => $this->getTitle()->getLocalURL() ) );
                }
 
                # Copyright

-- 
To view, visit https://gerrit.wikimedia.org/r/223265
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21cd072534ae1df960209e657b19c96889ece27c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to