MediaWiki: Difference between revisions

From Sasara
Jump to navigationJump to search
No edit summary
No edit summary
 
Line 38: Line 38:
  }
  }


==Page titles==
Sometimes you may want to change a page title without moving the page or changing its URL. There are two scenarios where I've found this useful.
===Fixing case===
MediaWiki capitalises titles, even if you're describing a proper noun that starts with a lowercase letter. Provided you're only changing the case, you can invoke the <code>DISPLAYTITLE</code> magic word to fix this:
<NOWIKI>{{DISPLAYTITLE:illumos}}</NOWIKI>
===Changing the title completely===
We use [[Home]] as our wiki landing page so that URLs are cleaner. but we want the title of the page to be "Sasara Home". You can use the <code>DISPLAYTITLE</code> magic word here too, but you need to relax the parser rules first. Add or change this in your <code>LocalSettings.php</code>:
$wgRestrictDisplayTitle = false;
[[Category:Tech]]
[[Category:Tech]]

Latest revision as of 03:05, 23 August 2025

MediaWiki is the wiki software we use for Sasara. It's also used on Wikimedia Foundation projects like Wikipedia and Wikimedia Commons.

Change homepage

Update link on MediaWiki:Mainpage to point to the new target home page.

Image uploads

Enabling uploads

Open LocalSettings.php, and change this option:

$wgEnableUploads = true;

Make sure the uploads folder is writable by the web server process. We run ours in a separate zfs dataset with execution off and quotas for security:

zfs create $DATASET/wiki/uploads
zfs set exec=off $DATASET/wiki/uploads
zfs set quota=1G $DATASET/wiki/uploads

Improve quality

The default quality setting for image compression is 80, which isn't great.

Open LocalSettings.php, and add the following option under wgEnableUploads:

$wgJpegQuality = 96;

Increasing size

Open php.ini, and change this to what you want:

upload_max_filesize = 8M

If you run nginx, you may need to add this to your nginx.conf file to prevent HTTP 413 Entity Too Large errors:

http {
    client_max_body_size 8M;
}

Page titles

Sometimes you may want to change a page title without moving the page or changing its URL. There are two scenarios where I've found this useful.

Fixing case

MediaWiki capitalises titles, even if you're describing a proper noun that starts with a lowercase letter. Provided you're only changing the case, you can invoke the DISPLAYTITLE magic word to fix this:

{{DISPLAYTITLE:illumos}}

Changing the title completely

We use Home as our wiki landing page so that URLs are cleaner. but we want the title of the page to be "Sasara Home". You can use the DISPLAYTITLE magic word here too, but you need to relax the parser rules first. Add or change this in your LocalSettings.php:

$wgRestrictDisplayTitle = false;