Miraheze 開發者維基

From Miraheze Developers Wiki
This page is a translated version of the page Miraheze Developers Wiki and the translation is 42% complete.

歡迎來到 Miraheze 開發者維基!
這是一個社區擁有的模板存儲庫,任何人都可以為他們的 Miraheze 維基獲取模板、JavaScript、CSS 或者 Lua 模塊。 如果你無法由此處引入模板,請於Miraheze's issue tracker 創建一個任務以列舉你需要的模板。



模板是被另一個頁面嵌入包含的頁面。 這對於多個地方使用的文本很有用,只需要於模板進行編輯就可以更改它出現的所有頁面。


舉個例子,開創一個頁面,命名為 Template:Main 並附上文本:''此處的主要文章是[[{{{1}}}]]''.,之後於你希望文本出現的位置插入模板{{Main|隨機頁面}}將會有下列結果:



This wiki is intended to be a central repository for Miraheze templates, JavaScript, CSS, or Lua modules.

Templates are a headache to disentangle, understand, install and maintain. Miraheze already makes life considerably easier for wiki admins, allowing them to focus on adding content instead of diverting time and energy to keeping up with the upgrade-debug race.

For full functionality MediaWiki ought to ship with templates bundled in but there is no sign of this happening any time soon. Miraheze wiki admins either write their own templates or export them from elsewhere e.g. Wikipedia.org. This is a wasteful dispersion of effort in place of collaboration.

Use the community portal for any meta discussions (about the wiki) or anything relevant to its intended purpose.


Using templates from this wiki won't prevent you from having unique templates on your wiki. The advantage of using templates from this wiki is that multiple people will have already put in the effort to make highly complex templates suitable for general use.

Writing your own templates.


Miraheze wikis are Instant Commons enabled, otherwise the images for icons would have to be uploaded locally. A good source for these is Wikimedia Commons' Category:Icons by subject.


For previewing a template do the following:

  1. Copy the templates to be tested under a common prefix. For example, you might copy Template:Foo to User:Example/sandbox/Template:Foo. Alternatively, you might create User:Example/sandbox/Template:Foo as a redirect to Template:Foo/sandbox.
  2. Go to Special:TemplateSandbox. Fill in the page or revision to be rendered, and the prefix you chose in step 1. It is possible to specify multiple prefixes by separating them using vertical bars, e.g. User:Example/sandbox1|User:Example/sandbox2.
  3. Click View.

There is also a box at the bottom of the edit form which allows for previewing some other page as it would appear were the template being edited saved with the current contents of the edit form.

Available templates