This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prettify.sh
84 lines (70 loc) · 4.25 KB
/
prettify.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# Welcome message and ASCII art
cat << "EOF"
██████ ██████ ███████ ████████ ████████ ██ ███████ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██████ █████ ██ ██ ██ █████ ████
██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ███████ ██ ██ ██ ██ ██
😍 A custom homepage and global accessibility and visual design improvements.
https://thepretty.wiki
https://try.thepretty.wiki
EOF
sleep 3
# Download Science & Design brand resources
cd /var/www/html/mediawiki/skins/Vector/resources/skins.vector.styles/
mkdir custom
cd custom/
git clone https://github.com/scidsg/brand-resources.git
mv brand-resources/fonts .
rm -r brand-resources/
# Activate New Skin
file="/var/www/html/mediawiki/LocalSettings.php"
backup_file="/var/www/html/mediawiki/LocalSettings.php.bak"
# Create a backup of the original file
cd /var/www/html/mediawiki/
cp "$file" "$backup_file"
# Enable The Pretty Wiki
sed -i 's/\$wgDefaultSkin = "vector";/\$wgDefaultSkin = "vector-2022";/g' "$file"
# Mobile enablement and enhancements
echo "Adding viewport meta tag, theme-color, and favicons to LocalSettings.php..."
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/favicon.ico
mkdir images/ images/favicon/
cd images/favicon/
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/images/favicon/android-chrome-192x192.png
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/images/favicon/android-chrome-512x512.png
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/images/favicon/apple-touch-icon.png
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/images/favicon/favicon-16x16.png
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/images/favicon/favicon-32x32.png
cat >> /var/www/html/mediawiki/LocalSettings.php << EOL
\$wgHooks["BeforePageDisplay"][] = "addViewportMetaTag";
function addViewportMetaTag( \$out, \$skin ) {
\$out->addHeadItem( "viewport", "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" );
\$out->addHeadItem( "theme-color", "<meta name=\"theme-color\" content=\"#333\">" );
\$out->addHeadItem( "apple-touch-icon", "<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/images/favicon/apple-touch-icon.png\">" );
\$out->addHeadItem( "favicon-32x32", "<link rel=\"icon\" type=\"image/png\" href=\"/images/favicon/favicon-32x32.png\" sizes=\"32x32\">" );
\$out->addHeadItem( "favicon-16x16", "<link rel=\"icon\" type=\"image/png\" href=\"/images/favicon/favicon-16x16.png\" sizes=\"16x16\">" );
\$out->addHeadItem( "android-chrome-192x192", "<link rel=\"icon\" type=\"image/png\" href=\"/images/favicon/android-chrome-192x192.png\" sizes=\"192x192\">" );
\$out->addHeadItem( "android-chrome-512x512", "<link rel=\"icon\" type=\"image/png\" href=\"/images/favicon/android-chrome-512x512.png\" sizes=\"512x512\">" );
return true;
}
EOL
# Back up Vector Skin
cd /var/www/html/mediawiki/skins
cp -r Vector/ Vector-Backup/
# Back up current less file
cd Vector/resources/skins.vector.styles/
mv skin.less old-skin.less
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/skin/skin.less
# Download skin files
cd custom/
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/skin/custom.less
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/skin/ddos.less
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/skin/homepage.css
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/skin/homepage.js
cd /var/www/html/mediawiki/extensions/
wget https://raw.githubusercontent.com/scidsg/the-pretty-wiki/main/skin/homepage.php
# Append LocalSettings
cd /var/www/html/mediawiki
echo 'require_once "$IP/extensions/homepage.php";' >> LocalSettings.php
echo '$wgEnableAPI = true;' >> LocalSettings.php