Manual:$wgLogos

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:$wgLogos and the translation is 17% complete.
Other languages:
English • ‎Nederlands • ‎français • ‎русский • ‎日本語
URL とファイル パス: $wgLogos
The URL path to various wiki logos.
導入されたバージョン:1.35.0 (Gerrit change 562588; git #8cd2e133)
除去されたバージョン:使用中
許容される値:(array of factors and relative paths or urls)
既定値:[ '1x' => $wgLogo ]/[ '1x' => "{$wgScriptPath }/resources/assets/wiki.png" ]
(注: この変数の既定値は、他の変数に依存します。例えば、LocalSettings.php の実行後に Setup.php 内で値が設定される変数です)

詳細

An array with factors and their associated relative paths or URL paths to the different versions of the wiki logo. (i.e. the image displayed in the upper-left corner of the page in most MediaWiki installations).

Supported variants

  • The icon version should be a square and should maximally have 50x50 pixels.
  • The 1.x version should be a square and should maximally have 135x135 pixels.
  • The 1.5x version should be a square and should maximally have 202x202 pixels.
  • The 2x version should be a square and should maximally have 270x270 pixels.
  • The svg version should be a square.

There are also two optional fields for additional assets to show next to the logo:

  • The wordmark should be a landscape logo, with maximum set width or height, as these are specified under the width and height keys.

Typically this is the graphic version of $wgSitename.

  • The same is true for the tagline, which typically corresponds to the non-sitename part of MediaWiki:Tagline.

All values (except width and height) can either be a fully-qualified URL or a relative path from DOCUMENT_ROOT. If it's a relative path, it has to start with a slash (a file in DOCUMENT_ROOT is /file.png, not file.png). Note that if you use a bigger image, MediaWiki will not resize this image! Instead, the image will be cut off so that only part of it (the upper left-hand corner to be precise) will be visible. If this corner is completely white, it might look like the image would not display although in fact it does.

$wgLogos = [
	'1x' => "path/to/1x_version.png",
	'1.5x' => "path/to/1.5x_version.png",
	'2x' => "path/to/2x_version.png",
	'svg' => "path/to/svg_version.svg",
	'icon' => "path/to/icon.png",  // A version of the logo without wordmark and tagline
	'wordmark' => [
		'src' => "path/to/wordmark_version.png",
		'1x' => "path/to/wordmark_version.svg", // optional if you want to support browsers with SVG support with an SVG logo.
		'width' => 135,
		'height' => 20,
	],
	'tagline' => [
		'src' => "path/to/tagline_version.png",
		'width' => 135,
		'height' => 15,
	],
];
警告! 警告: Do not simply overwrite the default logo installed with MediaWiki (/resources/assets/wiki.png). This file will automatically be overwritten when you upgrade and your changes will be lost.

関連項目