Skip to content

Commit

Permalink
Sync localSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair3149 committed Dec 31, 2024
1 parent e90f643 commit 5785a11
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions config/LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@
* MediaWiki thumbnailing is all over the place (T360589)
*
* TODO: Wait on https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1084920
* TODO: Set wgMediaViewerThumbnailBucketSizes once we move to MW 1.43
*
* List of image widths on the wiki
* 120px - File history on file page (ImageHistoryList.php)
Expand Down Expand Up @@ -372,18 +371,18 @@
$wgDefaultUserOptions['thumbsize'] = 2;
// Reduce the number of image sizes served in description page
$wgImageLimits = [
[ SCT_THUMB_SIZES[3][0], SCT_THUMB_SIZES[3][1] ], // image size 0
[ SCT_THUMB_SIZES[4][0], SCT_THUMB_SIZES[4][1] ], // image size 1
[ SCT_THUMB_SIZES[5][0], SCT_THUMB_SIZES[5][1] ], // image size 2
[ SCT_THUMB_SIZES[6][0], SCT_THUMB_SIZES[6][1] ], // image size 3
[ SCT_THUMB_SIZES[2][0], SCT_THUMB_SIZES[2][1] ], // image size 0
[ SCT_THUMB_SIZES[3][0], SCT_THUMB_SIZES[3][1] ], // image size 1
[ SCT_THUMB_SIZES[4][0], SCT_THUMB_SIZES[4][1] ], // image size 2
[ SCT_THUMB_SIZES[5][0], SCT_THUMB_SIZES[5][1] ], // image size 3
];
// Set to 1280px image by default
$wgDefaultUserOptions['imagesize'] = 2; // image size 2

// Use intermediary thumbnails to speed up thumbnail rendering
// This will result in several chained lossy transformations
// but we need it because the wiki uses a lot of high quality images
$wgThumbnailBuckets = [ SCT_THUMB_SIZES[5][0] ];
$wgThumbnailBuckets = [ SCT_THUMB_SIZES[4][0] ];
$wgThumbnailMinimumBucketDistance = 100;

// Gallery settings
Expand Down Expand Up @@ -776,6 +775,12 @@
* @see https://github.com/wikimedia/mediawiki-extensions-MultimediaViewer
*/
$wgMediaViewerEnableByDefault = true;
$wgMediaViewerThumbnailBucketSizes = [
SCT_THUMB_SIZES[2][0],
SCT_THUMB_SIZES[3][0],
SCT_THUMB_SIZES[4][0],
SCT_THUMB_SIZES[5][0]
];

/**
* Extension:MultiPurge
Expand Down Expand Up @@ -1414,20 +1419,3 @@
}
return true;
};

/** @see https://www.mediawiki.org/wiki/Manual:Hooks/SoftwareInfo */
$wgHooks['SoftwareInfo'][] = function( &$software ) {
// Add Wikidiff2 to "Installed software" in Special:Version
// Backported from http://phabricator.wikimedia.org/T339915
if ( phpversion( "wikidiff2" ) ) {
$software[ '[https://www.mediawiki.org/wiki/Wikidiff2 wikidiff2]' ] = phpversion( "wikidiff2" );
}
};

/** @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay */
$wgHooks['BeforePageDisplay'][] = function( $out, $skin ) {
// Don't index VE edit pages (https://phabricator.wikimedia.org/T319124)
if ( $out->getRequest()->getVal( 'veaction' ) ) {
$out->setRobotPolicy( 'noindex,nofollow' );
}
};

0 comments on commit 5785a11

Please sign in to comment.