This page is a translated version of the page Skin:Vector/2022 and the translation is 66% complete.
此皮肤随附于MediaWiki 1.38及更高版本。 因此您无需另外下载。 但是,您仍需遵循此页面提供的其他使用说明。
MediaWiki皮肤手冊 - 分类
Vector 2022
发行状态: 稳定版
兼容性政策 快照跟随MediaWiki发布。 master分支不向后兼容。
Composer mediawiki/vector-skin
许可协议 GNU通用公共协议2.0或更新版本
下载
示例 https://en.wikipedia.org/
https://vi.wikipedia.org/
https://test.wikipedia.org/
参数
  • $wgVectorNightMode
  • $wgVectorResponsive
  • $wgVectorStickyHeader
  • $wgVectorMaxWidthOptions
  • $wgVectorFontSizeConfigurableOptions
  • $wgVectorLanguageInHeader
  • $wgVectorLanguageInMainPageHeader
  • $wgVectorWvuiSearchOptions
  • $wgVectorTableOfContentsCollapseAtCount
  • $wgVectorPromoteAddTopic
  • $wgVectorWrapTablesTemporary
  • $wgVectorWebABTestEnrollment
  • $wgVectorDefaultSkinVersionForNewAccounts
  • $wgVectorDefaultSkinVersionForExistingAccounts
Quarterly downloads 632 (Ranked 1st)
正在使用的公开wiki数 14,010 (Ranked 2nd)
作为默认皮肤使用的公开wiki数 5,943
翻译Vector/2022皮肤(如在translatewiki.net可用)
Vagrant角色 vector
问题 : 开启的任务 · 报告错误

Vector 2022Vector皮肤的二次修改版。它是作为桌面版改进项目的一部分开发的。 它从MediaWiki 1.38 起被加入到MediaWiki中。 它是多个维基媒体项目的默认皮肤。

Vector 2022 与大多数皮肤的不同之处在于它没有自己的代码库;相反,它的代码是 Vector 皮肤的一部分,两者一起下载。

该皮肤自 MediaWiki 1.38 版起有第三方的正式支持。 请注意:运行MediaWiki 1.36或1.37的网站若在使用Vector 2022,则在升级到1.38版本时会遇到困难。 详情请见T299104擴展:WikimediaMaintenance

安裝

  • 下载文件,并将其放置在您skins/文件夹中的Vector目录内。
  • 将下列代码放置在您的LocalSettings.php 文件的底部:
    wfLoadSkin( 'Vector' );
    
  • 按需求配置。
  •   完成 - 在您的wiki上打开Special:Version,以确认皮肤已成功安装。

可选依赖

如果安装了以下扩展,Vector 2022 可以使用它们,尽管并不是必需的:

配置

将Vector 2022设为默认皮肤

自MediaWiki 1.38版本以来,将以下内容添加到LocalSettings.php即可使Vector 2022成为默认皮肤:

$wgDefaultSkin = 'vector-2022';

Night mode

MediaWiki版本:
1.43

Vector 2022 features a night mode or dark mode, which has three possible states:

  • day - also known as light mode
  • night - also known as dark mode
  • os - also known as automatic. This mode will automatically adapt to the state of the operating system or browser

Night mode is gated by a feature flag. To enable it, set $wgVectorNightMode as follows:

  • $wgVectorNightMode['beta'] = true;
  • $wgVectorNightMode['logged_out'] = true;
  • $wgVectorNightMode['logged_in'] = true;

When enabled, the default theme mode is day. To change the default theme for all users to automatic mode or night mode, you set the default for the user option with either:

$wgDefaultUserOptions['vector-theme'] = 'os'
// or 
$wgDefaultUserOptions['vector-theme'] = 'night'

Please note that your content has to be night mode compatible. You might want to read the recommendations for Wikimedia wikis .

参数

请注意,Vector 2022有几个不稳定的特性标志,它们可能随时消失。 这些特性标志中的大多数都与不完整的特性有关。 除非此处列出,否则建议不要更改任何特性标志的默认值。

  • $wgVectorMaxWidthOptions - 可用于配置是否适用 max-width。 目前相对稳定。
  • $wgVectorLanguageInMainPageHeader - 控制语言按钮是否显示在主页的页眉中。
  • $wgVectorWvuiSearchOptions - 键为showDescriptionshowThumbnail(均为布尔值)的关联数组。

Vector 2022 allows control over whether various menus appear pinned in the sidebar or collapsed into the header. These options can be configured both by users in their preferences and by administrators as default settings.

The following pinning options are available:

  • vector-main-menu-pinned - Controls the main navigation menu position
    • 1 (default) - Menu is pinned in the left sidebar
    • 0 - Menu is collapsed into header hamburger icon
  • vector-page-tools-pinned - Controls the page tools menu position
    • 1 (default) - Tools are pinned in the right sidebar
    • 0 - Tools are collapsed into header icon
  • vector-toc-pinned - Controls the table of contents position
    • 1 (default) - Table of contents is pinned in the left sidebar
    • 0 - Table of contents is collapsed into a floating button
  • vector-appearance-pinned - Controls the appearance menu position
    • 1 (default) - Appearance options are pinned in the sidebar
    • 0 - Appearance options are collapsed into header icon

To change any of these defaults, add the corresponding lines to LocalSettings.php:

// Example: Collapse all menus
$wgDefaultUserOptions['vector-main-menu-pinned'] = 0;
$wgDefaultUserOptions['vector-page-tools-pinned'] = 0;
$wgDefaultUserOptions['vector-toc-pinned'] = 0;
$wgDefaultUserOptions['vector-appearance-pinned'] = 0;

参见