Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodhfr/dd1389f90348744baf82e39a2b6902cd to your computer and use it in GitHub Desktop.
Save rodhfr/dd1389f90348744baf82e39a2b6902cd to your computer and use it in GitHub Desktop.
Making the Wiki Mobile Responsive
Certain steps are needed for this, nothing is easy with this platform. Albeit various approaches, the Wikipedia utilizes the extension MobileFrontend https://www.mediawiki.org/wiki/Extension:MobileFrontend to make the mobile users see other skin instead of the one that is showed in the desktop.
Some useful links
MobileFrontend GitHub https://github.com/wikimedia/mediawiki-extensions-MobileFrontend
Mobile Frontend configurations options page
Installing the extension MobileFrontend https://github.com/wikimedia/mediawiki-extensions-MobileFrontend#configuration-options
This is the download page https://www.mediawiki.org/wiki/Special:ExtensionDistributor/MobileFrontend to get the extension, this is also accessible via the MobileFrontend page in the MediaWiki's wiki. Download and extract. The current version of MediaWiki available in GitHub does not work with the last version of the MobilleFrontend (1.40) but the version 1.39 works fine. (Need to check later which version I'm on).
Download and extract
tar -xzf MobileFrontend-REL1_39-d871b82.tar.gz
Copy to the docker container folder /var/www/html/extensions
docker cp /home/user/Downloads/MobileFrontend mediawiki-main:/var/www/html/extensions/
Set up a skin
Add the following code at the bottom of your LocalSettings.php file and save:
# End of automatically generated settings.
# Add more configuration options below.
wfLoadExtension( 'MobileFrontend' ); // Load the extension module
wfLoadSkin( 'Vector' ); // Load the skin in the desktop also
$wgDefaultMobileSkin = 'minerva'; // set de default skin for mobile. minerva is the one wikipedia uses
$wgMFEnableResponsiveSkin = true; // Enable responsive skin switching
Maybe reload docker container
docker restart mediawiki-main
CD into the folder /var/www/html/maintenance and execute the following to update the PHP
php update.php
More about https://www.mediawiki.org/wiki/Manual:Update.php this PHP update thing, apparently this will be deprecated. There's a funny warning when php update.php is run.
Check if it's working
Navigate to Special:Version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment