MetaSetup

From WGVC MediaWiki
Jump to: navigation, search

Short URLs

Insert the following to /opt/bitnami/apps/mediawiki/conf/httpd-app.conf outside the Directory section:

RewriteEngine On
RewriteRule ^/?w(/.*)?$ /opt/bitnami/apps/mediawiki/htdocs/index.php [L]
RewriteRule ^/?$ /opt/bitnami/apps/mediawiki/htdocs/index.php [L]

For some reason the above Does not work when included in the root httpd.conf via an include of wgvc.conf.

And this to LocalSettings.php:

$wgArticlePath = '/w/$1';
# wgArticlePath docs (http://www.mediawiki.org/wiki/Manual:$wgArticlePath):
#   This is the base URL that will be used to construct all internal links
#   within MediaWiki. The default value points it to the main index.php
#   script using a relative URL, but if you are using .htaccess for pretty
#   URLs, this can be altered as required.

$wgUsePathInfo = true;

The key is that the w in the wgArticlePath needs to be kept in sync with that in the first RewriteRule, and be careful the mediawiki docs don't apply if the htdocs are not in fact under the document root.

See also http://www.mediawiki.org/wiki/Manual:Short_URL/Apache

Misc Customization and Configuration

bitnami@ip-10-137-62-244:/opt/bitnami/apps/mediawiki/htdocs$ diff LocalSettings.php LocalSettings.php.orig
21,22c21,22
< $wgSitename      = "WGVC MediaWiki";
< $wgMetaNamespace = "media.wgvc.com";
---
> $wgSitename      = "user's Wiki!";
> $wgMetaNamespace = "user's Wiki!";
36,41c36
< $wgLogo             = "$wgStylePath/common/images/wgvc-logo.png";
< 
< ## Only registered users edit
< $wgGroupPermissions['*']['edit']              = false;
< $wgGroupPermissions['*']['createaccount']    = false;
< $wgGroupPermissions['bureaucrat']['createaccount']    = true;
---
> $wgLogo             = "$wgStylePath/common/images/wiki.png";


gvc@uhura ~ $ scp -i /home/gvc/.ssh/wgvc-1.pem ~/Desktop/skins/common/images/wgvc-logo.png bitnami@ec2-50-17-5-99.compute-1.amazonaws.com:/opt/bitnami/apps/mediawiki/htdocs/skins/common/images/wgvc-logo.png

From the command line, create a user with Bureaucrat privileges (also works for sysop):

bitnami@ip-10-144-218-16:/opt/bitnami/apps/mediawiki/htdocs$ php maintenance/createAndPromote.php --username OliverCole --password WeakPassword
done.


From the command line, unprotect a page:

bitnami@ip-10-144-218-16:/opt/bitnami/apps/mediawiki/htdocs$ php maintenance/protect.php  --unprotect MediaWiki:Common.css

Syntax Highlighting

Next, Add this line to your LocalSettings.php:

    wfLoadExtension( 'SyntaxHighlight_GeSHi' );

To adjust the size of the source code font, add this to MediaWiki:Common.css:

.mw-highlight pre {
	font-size: 90%;
}


The Like Button

Use http://www.mediawiki.org/wiki/Manual:$wgRawHtml to enable things like the FB Like Button? No, here's how:

  1. Install Extensions as per http://www.mediawiki.org/wiki/Extension:Widgets
    • Being a Bureaucrat does not imply administratorship, it must be enabled separately.
  2. Create the page Widget:Like_button and copy in verbatim the source from http://www.mediawikiwidgets.org/w/index.php?title=Widget:Like_button
  3. Add the widget to the likable page:
    {{#widget:Like button|url=http://www.facebook.com/wgvcdotcom}}


Forcing the Preview Image on FB

Before you go through every single page of your site adding code and making images, check to make sure you don't already have a good image with Share Preview. Head over to Facebook, attempt to share a link and see what comes up. If you don't get an image (or at least not one you'd like) then continue on.

Find an image you want to use to represent your site. You could use a logo, an image from the site, or even a screenshot. Assuming you just want people to know how awesome your site would look in their browser, take a screenshot of your website. You can do this using the print screen button, Shift+Command+3 on a Mac, or some free screenshot software.

Before you upload the screenshot, use some image software to crop and edit it just the way you want it to look on the site. For loading purposes, I'd shink it down to 250px wide or less and compress it.

Upload the image. It's best if you upload it to the actual website you're generating a preview for. While it maybe work on another service like Flickr or Photobucket, some times won't load an off-site image preview.

Add a image source meta tag to the head of your document. The tag looks like this: < link rel="image_src" href="http://site.com/image.jpg" /> (Remove the space between < and link) Make sure you change the href to where the image is hosted, using the full URL. In order to get Share Preview and other features to read the image correctly, you need to make sure it's between the head tags in your html. It also helps to have the meta tags "title" and "description".


Read more: http://www.ehow.com/how_4938148_thumbnail-show-up-facebook-share.html#ixzz2r4ShPTfa

2014-01-22 Implemented this via OutputPageBeforeHTML in LocalSettings.php