mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-04 03:42:34 +02:00
chore: release Docusaurus v3.1 (#9705)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com> Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com> Co-authored-by: Ivan Mar (sOkam!) <7308253+heysokam@users.noreply.github.com> Co-authored-by: c0h1b4 <dwidman@gmail.com> Co-authored-by: Janessa Garrow <janessa.garrow@gmail.com> Co-authored-by: ozaki <29860391+OzakIOne@users.noreply.github.com> Co-authored-by: axmmisaka <6500159+axmmisaka@users.noreply.github.com> Co-authored-by: Tatsunori Uchino <tats.u@live.jp> Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com> fix(i18n): complete translations for theme-common.json Brazilian Portuguese (pt-BR) (#9477) fix(content-blog): add baseUrl for author.image_url (#9581) fix(type-aliases): add `title` prop for imported inline SVG React components (#9612) fix(utils): Markdown link replacement with <> but no spaces (#9617) fix(live-codeblock): stabilize react-live transformCode callback, fix editor/preview desync (#9631) fix(cli): output help when no conventional config + no subcommand (#9648) fix CI job (#9604) fix Lint Autofix workflow (#9632) fix(pwa-plugin): upgrade workbox (#9668) fix(create-docusaurus): fix init template code blocks, and little improvements (#9696) fix(theme): allow empty code blocks and live playgrounds (#9704)
This commit is contained in:
parent
a2e05d2118
commit
7b1b89041f
140 changed files with 3187 additions and 1707 deletions
|
@ -120,6 +120,45 @@ The API documentation of each official plugin lists the supported attributes:
|
|||
|
||||
:::
|
||||
|
||||
:::tip enhance your front matter
|
||||
|
||||
Use the [Markdown config `parseFrontMatter` function](../../api/docusaurus.config.js.mdx#markdown) to provide your own front matter parser, or to enhance the default parser.
|
||||
|
||||
It is possible to reuse the default parser to wrap it with your own custom proprietary logic. This makes it possible to implement convenient front matter transformations, shortcuts, or to integrate with external systems using front matter that Docusaurus plugins do not support.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
export default {
|
||||
markdown: {
|
||||
// highlight-start
|
||||
parseFrontMatter: async (params) => {
|
||||
// Reuse the default parser
|
||||
const result = await params.defaultParseFrontMatter(params);
|
||||
|
||||
// Process front matter description placeholders
|
||||
result.frontMatter.description =
|
||||
result.frontMatter.description?.replaceAll('{{MY_VAR}}', 'MY_VALUE');
|
||||
|
||||
// Create your own front matter shortcut
|
||||
if (result.frontMatter.i_do_not_want_docs_pagination) {
|
||||
result.frontMatter.pagination_prev = null;
|
||||
result.frontMatter.pagination_next = null;
|
||||
}
|
||||
|
||||
// Rename an unsupported front matter coming from another system
|
||||
if (result.frontMatter.cms_seo_summary) {
|
||||
result.frontMatter.description = result.frontMatter.cms_seo_summary;
|
||||
delete result.frontMatter.cms_seo_summary;
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
// highlight-end
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
## Quotes {#quotes}
|
||||
|
||||
Markdown quotes are beautifully styled:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue