Dereckson has uploaded a new change for review.

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

Change subject: Allow a wiki to use __NOINDEX__ and __INDEX__ in all namespaces
......................................................................

Allow a wiki to use __NOINDEX__ and __INDEX__ in all namespaces

Currently, __NOINDEX__ and __INDEX__ robot control keywords can be used
in all namespaces excepted:
  - the content ones (from $wgContentNamespaces)
  - the ones in $wmgExemptFromUserRobotsControlExtra

There is legitimate cases not to index pages from content namespaces
in specific cases, like non content wikis.

We so provide a mechanism to allow a wiki to use these keywords
everywhere to avoid direct robots.txt tweaking.

Change-Id: Iffb77a0401a8dda537c769b612613763d448a3cc
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/12/321712/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 6477444..b2e47a5 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -3194,7 +3194,11 @@
        return true;
 };
 
-$wgExemptFromUserRobotsControl = array_merge( $wgContentNamespaces, 
$wmgExemptFromUserRobotsControlExtra );
+if ( $wmgAllowRobotsControlInAllNamespaces ) {
+       $wgExemptFromUserRobotsControl = [];
+} else {
+       $wgExemptFromUserRobotsControl = array_merge( $wgContentNamespaces, 
$wmgExemptFromUserRobotsControlExtra );
+}
 
 // additional "language names", adding to Names.php data
 $wgExtraLanguageNames = $wmgExtraLanguageNames;
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index bb7f9e2..46cae6f 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -11282,7 +11282,15 @@
        '+plwiki' => [ NS_USER, 100, 102 ], // T133978; 100 -> Portal, 102 -> 
Wikiproject
 ],
 
+'wmgAllowRobotsControlInAllNamespaces' => [
+       // If true, allows to use __NOINDEX__ and __INDEX__ everywhere, even in 
(main).
+       'default' => false,
+],
+
 'wmgExemptFromUserRobotsControlExtra' => [
+       // When wmgAllowRobotsControlInAllNamespaces is false (the default),
+       // __NOINDEX__ and __INDEX__ will be ignored for these namepaces,
+       // as well as for namespaces in $wgContentNamespaces.
        'default' => [],
        'enwiki' => [ 118, 119 ], // draft and draft talk
        'hewiki' => [ 118, 119 ], // draft and draft talk - T86329

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iffb77a0401a8dda537c769b612613763d448a3cc
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Dereckson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to