Manual:$wgLogos
| サーバー URL とファイル パス: $wgLogos | |
|---|---|
| 各種ウィキロゴのURLパスです。 |
|
| 導入されたバージョン: | 1.35.0 (Gerrit change 562588; git #8cd2e133) |
| 除去されたバージョン: | 使用中 |
| 許容される値: | (倍率と相対パス又はURLの配列) |
| 既定値: | false(注: この変数の既定値は、他の変数に依存します。例えば、LocalSettings.php の実行後に Setup.php 内で値が設定される変数です) |
| その他の設定: アルファベット順 | 機能順 | |
LocalSettings.php のこの変数は、サイト ロゴとして使用する 1 つ以上のファイルの場所を指定します。 The site logo is a standard interface element of most MediaWiki skins and is most commonly recognisable as the image displayed in the upper-left corner of every page.
ウィキロゴの異なるバージョンへの因子とそれらに関連する相対パスまたはURLパスがある配列。
これは、MediaWiki 1.35 より前に使用されていた $wgLogo を置き換えます。
詳細
MediaWiki にインストールされている既定のロゴを単に上書きしないでください。 (/resources/assets/wiki.png); this file will be overwritten when you upgrade the software. |
サーバーの設定によっては、どの画像を使用するかの情報がサーバーキャッシュ内にキャッシュされることがあります。 また、対応する画像ファイルを変更した場合、画像がウェブ ブラウザー内に長期間キャッシュされ、新しいロゴがすぐに表示されない場合があります。 この場合、キャッシュを空にして、ブラウザーがサーバーから最新バージョンをダウンロードできるようにするため、ウェブ ブラウザーで画像 URL を再読み込みする必要がある場合があります。 |
対応キー
- icon
- これは、Vector 2022 外装のサイト ロゴに使用され、50×50 ピクセル (または SVG 相当) で表示されます。また、Timeless, Refreshed, Citizen 外装では通常、より大きなサイズで表示されます。 他の外装がこれに対応している場合、通常より大きなアイコンを必要とするため、代わりに SVG を使用することをお勧めします。 正方形で、HiDPIに対応するためにSVGの場合は公称50×50ピクセル、ラスターの場合は100×100ピクセルである必要があります。 現在、このキーのサポートは前述の外装に限定されていますが、すべての新しい外装でのサポートが推奨されます。
- 1x
- これは、legacy Vector および MonoBook 外装、その他いくつかの外装で使用されます。[clarification needed] 画像の幅は 135px、高さは最大で約 155px にしてください。 これは、1.5 倍版と 2 倍版は公称幅 135px を想定しており、高さ 155px までなら標準的な外装で問題なく収まるからです。[clarification needed] 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. これは古い外装をサポートしており、長期的な将来には廃止予定となる予定です。 お好みの「アイコン」をサポートする外装をお勧めします。
- 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). このキーは将来的に非推奨となり、その使用は推奨されない。
- 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). このキーは将来的に非推奨となり、その使用は推奨されない。
- svg
- This is used for SVG logos instead of the separate
1x,1.5x,2xkeys, but should follow the same size guidelines (nominally) as those keys, fitting within 135px wide and 155px tall when sized to 135px wide. このキーは将来的に非推奨となり、その使用は推奨されない。
また、ロゴの横に表示する追加アセット用のオプションフィールドが2つあります。
- wordmark
- This should be a landscape image (wider than it is tall), with its maximum width and height set by the
widthandheightkeys. The width should not exceed 124px and the height should not exceed 32px. これは通常、$wgSitenameのグラフィック版である。 これは、Vector 2022 (1.36)、Timeless、Minerva、Citizen で使用されています。 - tagline
- The requirements here are the same as for the wordmark. タグラインも同様で、通常はMediaWiki:Taglineのサイト名でない部分(例:「The Free Encyclopedia」「フリー百科事典」)に相当します。 The combined height of the tagline and wordmark should not exceed 50px.
すべての値(widthとheightを除く)は、完全修飾URLかll|Manual:Installing MediaWiki#Document rootからの相対パスのどちらかになります。
相対パスの場合は、スラッシュで始まる必要があります($1のファイルは/file.pngであり、file.pngではない)。
Example images
例
$wgLogos = [
'1x' => "1倍版へのパス.png",
'1.5x' => "1.5倍版へのパス.png",
'2x' => "2倍版へのパス.png",
'svg' => "svgバージョンへのパス.svg",
'icon' => "path/to/icon.png", // ワードマークとキャッチフレーズを除いたバージョン
'wordmark' => [
'src' => "ワードマークバージョンへのパス.png",
'1x' => "path/to/wordmark_version.svg", // SVGをサポートしているブラウザをSVGロゴでサポートしたい場合は、オプションで指定します。
'width' => 135,
'height' => 20,
],
'tagline' => [
'src' => "タグラインバージョンへのパス.png",
'width' => 135,
'height' => 15,
],
];
簡易版の例
$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
];
パスの例
$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,
],
];
言語変種にロゴを追加
The functionality to override logos for different language variants was introduced in version 1.36.0 (Gerrit change 627939, git #8cd2e133). 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", // 1倍版へのパス
'1.5x' => "path/to/1.5x_version.png", // 1.5倍版へのパス
'2x' => "path/to/2x_version.png", // 2倍版へのパス
'svg' => "path/to/svg_version.svg", // svgバージョンへのパス
'icon' => "path/to/icon.png", // ワードマークとキャッチフレーズを除いたバージョン
'wordmark' => [
'src' => "path/to/wordmark_version.png", // ワードマークバージョンへのパス
'1x' => "path/to/wordmark_version.svg", // SVGをサポートしているブラウザをSVGロゴでサポートしたい場合は、オプションで指定します。
'width' => 135,
'height' => 20,
],
'tagline' => [
'src' => "path/to/tagline_version.png", // タグライン バージョンへのパス
'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", // 言語変種からwordmark版へのパス
'1x' => "path/to/language_variant_wordmark_version.svg", // SVG 対応のブラウザで言語変種に対して SVG ロゴを加えるオプション。
'width' => 135,
'height' => 20,
],
],
],
];