Jump to content

Manual:$wgLogos

From mediawiki.org
This page is a translated version of the page Manual:$wgLogos and the translation is 25% complete.
Outdated translations are marked like this.
URLs de servidor e caminhos de arquivo: $wgLogos
O caminho da URL para vários logotipos da wiki.
Introduzida na versão:1.35.0 (Gerrit change 562588; git #8cd2e133)
Removida na versão:Ainda em uso
Valores permitidos:(matriz de fatores e caminhos ou urls relativos)
Valor padrão:false
(Nota: O valor padrão dessa variável depende de outras variáveis, tais como os valores definidos em Setup.php , after LocalSettings.php é executado)

This variable in LocalSettings.php specifies the location of one or more files to be used as the site logo. (ou seja, a imagem exibida no canto superior esquerdo da página na maioria das instalações do MediaWiki).

Uma matriz com fatores e seus caminhos relativos associados ou caminhos de URL para as diferentes versões do logotipo da wiki.

This replaces $wgLogo , which was used before MediaWiki 1.35 .

Detalhes

Atenção! Atenção: Do not simply overwrite the default logo installed at MediaWiki (/resources/assets/wiki.png); this file will be overwritten when you upgrade the software.
The recommended size of a square logo for the legacy Vector skin is 135×135 pixels for a raster image (e.g., PNG) and 50×50 (nominally) for a vector image (SVG), though the logo does not have to be square, especially if it includes text below a picture, like Wikipedia's logo from 2010. The recommended logo size in the newer Vector 2022 skin is 100×100 pixels for raster and 50×50 (nominally) for vector. The maximum logo size in legacy Vector is about 160×160 pixels, while in MonoBook it's about 155×155.

Variantes suportadas

icon
This is used for the site logo in the Vector 2022 skin, where it is shown at 50×50 pixels (or SVG equivalent), and in the Timeless , Refreshed , Citizen skins, where it is typically shown at larger sizes. Observe que outras capas normalmente requerem um ícone maior se suportarem isso, portanto, usar um SVG em vez disso é recomendado, pois será dimensionado corretamente em todos eles. Otherwise, the image should be square and 100×100 pixels if a raster image like PNG in order to support HiDPI. O suporte atual para esta chave é limitado a $1, $2 e $3, mas isso é recomendado para todos as novas skins.
1x
This is used by the legacy Vector and MonoBook skins, and some others.[necessário esclarecer] The image should be 135px wide by up to around 155px tall. Isso ocorre porque as versões 1,5x e 2x assumem uma largura nominal de 135px e até 155px de altura cabem sem problemas em skins padrão.[necessário esclarecer] A larger size logo can be used by modifying the site's CSS, but MediaWiki will not shrink a logo that is too large. Instead, only part of the image (specifically the upper left-hand corner) will be visible, and if this corner is white it may seem like the image is not being displayed at all. Isso suporta skins mais antigas e no futuro a longo prazo será preterido. Recomendamos que as skins suportem o `icon` preferido.
1.5x
This image should be 202px wide and match the aspect ratio of the 1x image (so up to 232px tall, for 155px nominal height). A chave será descontinuada no futuro e seu uso não é recomendado.
2x
This image should be 270px wide and match the aspect ratio of the 1x image (so up to 310px tall, for 155px nominal height). A chave será descontinuada no futuro e seu uso não é recomendado.
svg
This is used for SVG logos instead of the separate 1x, 1.5x, 2x keys, but should follow the same size guidelines (nominally) as those keys, fitting within 135px wide and 155px tall when sized to 135px wide. A chave será descontinuada no futuro e seu uso não é recomendado.

Existem também dois campos opcionais para recursos adicionais a serem exibidos ao lado do logotipo:

wordmark
This should be a landscape image (wider than it is tall), with its maximum width and height set by the width and height keys. The width should not exceed 124px and the height should not exceed 32px. Normalmente, esta é a versão gráfica de $wgSitename. Isso é usado Vector 2022 (1,36), Timeless , Minerva
tagline
The requirements here are the same as for the wordmark. * O mesmo é verdadeiro para o tagline, que normalmente corresponde à parte que não é do nome do site de MediaWiki:Tagline. The combined height of the tagline and wordmark should not exceed 50px.

Todos os valores (exceto width e height) podem ser um URL totalmente qualificado ou um caminho relativo de ll|Manual:Installing MediaWiki#Document root. Se for um caminho relativo, ele deve começar com uma barra (um arquivo em $1 é /file.png, não file.png).

Example images

Exemplo

$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",  // version of logo without wordmark and tagline
	'wordmark' => [
		'src' => "path/to/wordmark_version.png",
		'1x' => "path/to/wordmark_version.svg",  // optional: support SVG in addition to PNG
		'width' => 135,
		'height' => 20,
	],
	'tagline' => [
		'src' => "path/to/tagline_version.png",
		'width' => 135,
		'height' => 15,
	],
];

Simple example

$wgLogos = [
	'icon' => "$wgScriptPath/lol.png",            // path to primary logo for Vector 2022
	'1x' => "$wgScriptPath/myCustomLogo.png",     // path to 1x version for other skins
	'2x' => "$wgResourceBasePath/hiResLogo.png",  // path to 2x version for other skins
];

Example paths

There is no special significance to the choices of whether to use relative file paths or URLs in this example.
$wgLogos = [
	'1x' => "/lol.png",    // relative path to file in document root
	'1.5x' => "https://mywiki.org/w/resources/assets/lol.png",  // full URL to elsewhere
	'2x' => "/lol.png",    // relative paths always start with a slash
	//  'svg' => "",       // svg key has been deprecated
	'icon' => "/lol.png",  // 50×50 SVG or 100×100 PNG (limited support)
	'wordmark' =>  [
		'src' => "/wordmark_sitename.png",  // image of sitename text (limited support)
		'width' => 135,
		'height' => 20,
	],
	'tagline' => [
		'src' => "/tagline_subtitle.png",   // image of tagline text without sitename (limited support)
		'width' => 135,
		'height' => 15,
	],
];

Adding logos for language variants

The functionality to override logos for different language variants was introduced in version 1.36.0 (Gerrit change 627939, git #8cd2e133). See T261153.

When defining variants, any language key can be used, for example it is possible to provide a German variant of an English logo.

This was extended to apply to all logo keys in 1.39.0.

$wgLogos = [
	'1x' => "path/to/1x_version.png",      // path to 1x version
	'1.5x' => "path/to/1.5x_version.png",  // path to 1.5x version
	'2x' => "path/to/2x_version.png",      // path to 2x version
	'svg' => "path/to/svg_version.svg",    // path to svg version
	'icon' => "path/to/icon.png",          // A version of the logo without wordmark and tagline
	'wordmark' => [
		'src' => "path/to/wordmark_version.png",  // path to wordmark version
		'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",	  // path to tagline version
		'width' => 135,
		'height' => 15,
	],
	'variants' => [
		'variant-code' => [
			'1x' => "path/to/language_variant_1x_version.png",      // path to 1x version in language variant
			'1.5x' => "path/to/language_variant_1.5x_version.png",  // path to 1.5x version in language variant
			'2x' => "path/to/language_variant_2x_version.png",      // path to 2x version in language variant
			'svg' => "path/to/language_variant_svg_version.svg",    // path to svg version in language variant
			'icon' => "path/to/language_variant_icon.png",          // A version of the logo without wordmark and tagline in language variant
			'wordmark' => [
				'src' => "path/to/language_variant_wordmark_version.png",  // path to wordmark version in language variant
				'1x' => "path/to/language_variant_wordmark_version.svg",   // optional if you want to support browsers with SVG support with an SVG logo in language variant.
				'width' => 135,
				'height' => 20,
			],
		],
	],
];

Ver também