jenkins-bot has submitted this change and it was merged.

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, 14 insertions(+), 1 deletion(-)

Approvals:
  Thcipriani: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 85dd884..d7054d9 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -3233,7 +3233,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 06e1430..26a74a0 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -11312,7 +11312,16 @@
        '+plwiki' => [ NS_USER, 100, 102 ], // T133978; 100 -> Portal, 102 -> 
Wikiproject
 ],
 
+'wmgAllowRobotsControlInAllNamespaces' => [
+       // If true, allows to use __NOINDEX__ and __INDEX__ everywhere,
+       // even in content namespaces (see $wgContentNamespaces).
+       '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: merged
Gerrit-Change-Id: Iffb77a0401a8dda537c769b612613763d448a3cc
Gerrit-PatchSet: 3
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Dereckson <[email protected]>
Gerrit-Reviewer: Dereckson <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: MZMcBride <[email protected]>
Gerrit-Reviewer: MarcoAurelio <[email protected]>
Gerrit-Reviewer: Thcipriani <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to