Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure MinervaNeue as mobile theme #36

Merged
merged 3 commits into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 5 additions & 0 deletions test/integration/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,9 @@ if [[ $CURL_OUTPUT != *"Powered by MediaWiki"* ]]; then
error "Main page failed to load properly: "$CURL_OUTPUT
fi

MOBILE_CURL_OUTPUT=$(curl -sSL $NGINX_ADDR'/index.php?title=Main_Page&mobileaction=toggle_view_mobile')
if [[ $MOBILE_CURL_OUTPUT != *"Special:MobileMenu"* ]]; then
error "Main page failed to load properly on mobile: "$MOBILE_CURL_OUTPUT
fi

info "Tests complete"