Skip to content

Commit

Permalink
Configure MinervaNeue as mobile theme
Browse files Browse the repository at this point in the history
Previously this was bundled with MobileExtension, but now we need to
download and configure it manually.
  • Loading branch information
amrav committed Feb 1, 2018
1 parent a026fe1 commit f87f56c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
10 changes: 2 additions & 8 deletions mediawiki/LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
$wgMetaNamespace = "Metakgp";

wfLoadSkin('Vector');
wfLoadSkin('MinervaNeue'); # mobile optimised

## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
Expand Down Expand Up @@ -127,14 +128,6 @@
## names, ie 'vector', 'monobook':
$wgDefaultSkin = "vector";

# Enabled skins.
# The following skins were automatically enabled:
#require_once "$IP/skins/CologneBlue/CologneBlue.php";
#require_once "$IP/skins/Modern/Modern.php";
#require_once "$IP/skins/MonoBook/MonoBook.php";
require_once "$IP/skins/Vector/Vector.php";
#require_once "$IP/skins/brlcad/brlcad.php";

# End of automatically generated settings.
# Add more configuration options below.

Expand Down Expand Up @@ -185,6 +178,7 @@

wfLoadExtension('MobileFrontend');
$wgMFAutodetectMobileView = true;
$wgMFDefaultSkinClass = 'SkinMinerva';

require_once "$IP/extensions/ContributionScores/ContributionScores.php";
$wgContribScoreIgnoreBots = true; // Exclude Bots from the reporting - Can be omitted.
Expand Down
18 changes: 18 additions & 0 deletions mediawiki/install_extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ declare -a extension_names=( \
googleAnalytics \
)

declare -a skin_names=( \
MinervaNeue \
)

MEDIAWIKI_RELEASE=REL1_30

function fetch_extension_url() {
Expand All @@ -24,6 +28,12 @@ function fetch_extension_url() {
| head -1
}

function fetch_skin_url() {
curl -s "https://www.mediawiki.org/wiki/Special:SkinDistributor?extdistname=$1&extdistversion=$MEDIAWIKI_RELEASE" \
| grep -oP 'https://extdist.wmflabs.org/dist/skins/.*?.tar.gz' \
| head -1
}

cd /tmp
for extension_name in "${extension_names[@]}"; do
versioned_extension_url=$(fetch_extension_url $extension_name)
Expand All @@ -33,6 +43,14 @@ for extension_name in "${extension_names[@]}"; do
mv $extension_name /srv/mediawiki/extensions/
done

for skin_name in "${skin_names[@]}"; do
versioned_skin_url=$(fetch_skin_url $skin_name)
versioned_skin_name=$(echo $versioned_skin_url | awk -F"/" '{print $(NF)}')
wget -q $versioned_skin_url
tar -xzf "$versioned_skin_name"
mv $skin_name /srv/mediawiki/skins/
done

# Get RecentPages from Github
wget -q https://github.com/leucosticte/RecentPages/archive/master.zip \
&& unzip master.zip -d RecentPages \
Expand Down

0 comments on commit f87f56c

Please sign in to comment.