MediaWiki extension NearbyPages

Clone this repo:
  1. 38ad3c4 Localisation updates from https://translatewiki.net. by Translation updater bot · 2 days ago master wmf/branch_cut_pretest wmf/next
  2. ca04efd build: Updating mediawiki/mediawiki-codesniffer to 45.0.0 by libraryupgrader · 6 days ago wmf/1.44.0-wmf.2
  3. 359a152 build: Updating @wikimedia/codex to 1.15.0 by libraryupgrader · 9 days ago
  4. dcbc6e9 eslint: Use server config for root, cleanup client configs by Ed Sanders · 3 weeks ago
  5. d343f51 Localisation updates from https://translatewiki.net. by Translation updater bot · 3 weeks ago REL1_43 wmf/1.43.0-wmf.28 wmf/1.44.0-wmf.1

Installation

wfLoadExtension( 'NearbyPages' );

Sourcing content

To get NearbyPages showing articles from your favorite mediawiki instance you'll need to first config the $wgNearbyPagesUrl config variable.

$wgNearbyPagesUrl = "https://en.wikipedia.org/w/api.php";

For wikidata wikis a little more configuration is required like so:

$wgNearbyPagesNamespaces = [ 640, 146, 0 ];
$wgNearbyPagesWikidataCompatibility = true;
$wgNearbyPagesUrl = "https://www.wikidata.org/w/api.php";

Note for wikis running MobileFrontend

To avoid compatibility issues, ensure that MobileFrontend version 2.3.0 is running.

Development

You can begin development on Special:NearbyPages with 2 simple commands:

npm install
npm start

To develop on Wikidata using this mode, edit resources/ext.nearby.scripts/config.json before running the command substituting the following values:

NearbyPagesNamespaces: [ 640, 146, 0 ],
NearbyPagesUrl: 'https://www.wikidata.org/w/api.php',
NearbyPagesWikidataCompatibility: true