Extension:Metadata/pt-br

From mediawiki.org
This page is a translated version of the page Extension:Metadata and the translation is 0% complete.
Manual de extensões do MediaWiki
Metadata
Estado da versão: experimental
Descrição Adds #metadata parser function to set page properties, and expose them via ‎<meta> tags and a REST API endpoint
Autor(es) Sophivorusdiscussão
Última versão 4.0
MediaWiki >= 1.35.0
Licença GNU GPL (Licença Pública Geral) 3.0 ou superior
Download
Quarterly downloads 3 (Ranked 141st)
Para traduzir a extensão Metadata, verifique sua disponibilidade no translatewiki.net

The Metadata extension adds the #metadata parser function to set page properties, and exposes them via ‎<meta> tags and a REST API endpoint.

Installation

  • Baixe e coloque o(s) arquivo(s) num diretório chamado Metadata na sua pasta extensions/.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Metadata
  • Adicione o seguinte código ao final do seu arquivo LocalSettings.php :
    wfLoadExtension( 'Metadata' );
    
  • Yes Concluído – Navegue à página Special:Version em sua wiki para verificar se a instalação da extensão foi bem sucedida.

Usage

To set a simple key-value pair for the current page:

{{#metadata:key=value}}

And to set multiple key-value pairs in a single call:

{{#metadata:
| key = value
| foo = bar
| baz
}}

Keys with no value will be assigned a "1" value.

Once set, the properties will be accessible via the HTML <meta> tags, like so:

<meta name="key" content="value" />
<meta name="foo" content="bar" />
<meta name="baz" content="1" />

And also, via the "props" endpoint introduced by this extension to the MediaWiki REST API, with the following URL pattern:

/w/rest.php/v1/page/{title}/props

Finally, the properties can also be accessed via the Properties module of the MediaWiki Action API, with the following URL pattern:

/w/api.php?action=query&prop=pageprops&titles={title}

See also