Ir para o conteĆŗdo principal
Version: 2.2.0

šŸ“¦ plugin-content-pages

O plugin de pĆ”ginas padrĆ£o para o Docusaurus. O modelo clĆ”ssico Ć© fornecido com este plugin com configuraƧƵes padrĆ£o. Esse plugin fornece funcionalidade de criaĆ§Ć£o de pĆ”ginas.

InstalaĆ§Ć£oā€‹

npm install --save @docusaurus/plugin-content-pages
tip

If you use the preset @docusaurus/preset-classic, you don't need to install this plugin as a dependency.

VocĆŖ pode configurar este plugin atravĆ©s das opƧƵes de predefiniĆ§Ć£o.

ConfiguraĆ§Ć£oā€‹

Campos aceitos:

NomeTypePadrĆ£oDescriĆ§Ć£o
pathstring'src/pages'Path to data on filesystem relative to site dir. Components in this directory will be automatically converted to pages.
routeBasePathstring'/'URL route for the pages section of your site. DO NOT include a trailing slash.
includestring[]['**/*.{js,jsx,ts,tsx,md,mdx}']Os arquivos correspondentes serĆ£o incluĆ­dos e processados.
excludestring[]See example configurationNo route will be created for matching files.
mdxPageComponentstring'@theme/MDXPage'Componente usado em cada pƔgina MDX.
remarkPlugins[]any[]Remark plugins passed to MDX.
rehypePlugins[]any[]Rehype plugins passed to MDX.
beforeDefaultRemarkPluginsany[][]Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins.
beforeDefaultRehypePluginsany[][]Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins.

ConfiguraĆ§Ć£o de exemploā€‹

VocĆŖ pode configurar este plugin atravĆ©s das opƧƵes de predefiniĆ§Ć£o ou opƧƵes do plugin.

tip

A maioria dos usuĆ”rios do Docusaurus configura este plugin atravĆ©s das configuraƧƵes de predefiniĆ§Ć£o.

If you use a preset, configure this plugin through the preset options:

docusaurus.config.js
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
pages: {
path: 'src/pages',
routeBasePath: '',
include: ['**/*.{js,jsx,ts,tsx,md,mdx}'],
exclude: [
'**/_*.{js,jsx,ts,tsx,md,mdx}',
'**/_*/**',
'**/*.test.{js,jsx,ts,tsx}',
'**/__tests__/**',
],
mdxPageComponent: '@theme/MDXPage',
remarkPlugins: [require('remark-math')],
rehypePlugins: [],
beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [],
},
},
],
],
};

i18nā€‹

Leia a introduĆ§Ć£o i18n primeiro.

LocalizaĆ§Ć£o dos arquivos de traduĆ§Ć£oā€‹

  • Base path: website/i18n/[locale]/docusaurus-plugin-content-pages
  • Multi-instance path: website/i18n/[locale]/docusaurus-plugin-content-pages-[pluginId]
  • Arquivos JSON: extraĆ­dos com docusaurus escreveu-traduƧƵes
  • Markdown files: website/i18n/[locale]/docusaurus-plugin-content-pages

Exemplo de estrutura de sistema de arquivosā€‹

website/i18n/[locale]/docusaurus-plugin-content-pages
ā”‚
ā”‚ # translations for website/src/pages
ā”œā”€ā”€ first-markdown-page.md
ā””ā”€ā”€ second-markdown-page.md