docusaurus/website/blog/releases/3.5/index.mdx
2024-08-23 12:38:51 +02:00

146 lines
7.3 KiB
Text

---
title: Docusaurus 3.5
authors: [slorber]
tags: [release]
image: ./img/social-card.png
date: 2024-08-09
---
We are happy to announce **Docusaurus 3.5**.
This release contains many **new exciting blog features**.
Upgrading should be easy. Our [release process](/community/release-process) respects [Semantic Versioning](https://semver.org/). Minor versions do not include any breaking changes.
![Docusaurus blog post social card](./img/social-card.png)
{/* truncate */}
## Highlights
### Blog Social Icons
In [#10222](https://github.com/facebook/docusaurus/pull/10222), we added the possibility to associate social links to blog authors, for inline authors declared in front matter or global through the `authors.yml` file.
```yml title="blog/authors.yml"
slorber:
name: Sébastien Lorber
# other author properties...
# highlight-start
socials:
x: sebastienlorber
linkedin: sebastienlorber
github: slorber
newsletter: https://thisweekinreact.com
# highlight-end
```
![Author socials screenshot displaying `slorber` author with 4 social platform icons](./img/author-socials.png)
Icons and handle shortcuts are provided for pre-defined platforms `x`, `linkedin`, `github` and `stackoverflow`. It's possible to provide any additional platform entry (like `newsletter` in the example above) with a full URL.
### Blog Authors Pages
In [#10216](https://github.com/facebook/docusaurus/pull/10216), we added the possibility for [global blog authors](/docs/blog#global-authors) (declared in `authors.yml`) to have their own dedicated page listing all the blog posts they contributed to.
This feature is opt-in and mostly relevant for **multi-author blogs**. You can turn it on for a specific author by setting the `page: true` property:
```yml title="blog/authors.yml"
slorber:
name: Sébastien Lorber
# the description will be displayed on the author's page
description: 'A freelance React and React-Native developer...'
# highlight-next-line
page: true # Turns the feature on
```
This creates a [dedicated author page](/blog/authors/slorber) at `/blog/authors/slorber`.
![Author page screenshot for `slorber` global author](./img/author-page.png)
An [authors index page](/blog/authors) is also created, listing all the blog authors.
![Author index page listing multiple authors](./img/author-index.png)
Check the [blog authors pages guide](/docs/blog#authors-pages) for details.
### Blog Feeds Styling
In [#9252](https://github.com/facebook/docusaurus/pull/9252), we added support for [styling your blog feeds](https://darekkay.com/blog/rss-styling/) by providing custom XSLT `.xls` files for the RSS and Atom feeds. This allows browsers to render the feeds in a more visually appealing way, like a regular HTML page, instead of the default XML view.
```js title="website/docusaurus.config.js"
const blogOptions = {
feedOptions: {
// highlight-start
xslt: {
rss: 'custom-rss.xsl',
atom: 'custom-atom.xsl',
},
// highlight-end
},
};
```
Writing your own XSLT can be complex, but you can also use `xslt: true` to turn on the built-in style:
```js title="website/docusaurus.config.js"
const blogOptions = {
feedOptions: {
// highlight-start
xslt: true,
// highlight-end
},
};
```
![Screenshot of the Docusaurus blog RSS feed, beautifully styled](./img/blog-feed-xslt.png)
### Blog Sidebar Grouping
In [#10252](https://github.com/facebook/docusaurus/pull/10252), we added support for grouping blog posts by years in the blog sidebar.
![Screenshot of the Docusaurus blog, in particular the sidebar items grouped by year](./img/blog-sidebar-years.png)
This feature is now turned on by default, but can be disabled with `themeConfig.blog.sidebar.groupByYear: false`.
### Blog Consistency Options
We added new blog options to enforce recommended practices for your blog posts:
#### `onInlineAuthors`
We believe large multi-blogs are easier to manage by using [global authors](/docs/blog#global-authors), declared in `authors.yml`. This notably permits to avoids duplicating author information across multiple blog posts, and now permits to generate [author pages](/docs/blog#authors-pages).
In [#10224](https://github.com/facebook/docusaurus/pull/10224), we added the `onInlineAuthors` option. Use `onInlineAuthors: 'throw'` to forbid [inline authors](/docs/blog#inline-authors), and enforce a consistent usage of [global authors](/docs/blog#global-authors).
#### `onUntruncatedBlogPost`
We believe blog posts are better using [truncation markers](/docs/blog#blog-list) (`<!-- truncate -->` or `{/* truncate */}`). On paginated lists (blog home, tags pages, authors pages), this permits to render a more concise preview of the blog post instead of a full blog post.
In [#10375](https://github.com/facebook/docusaurus/pull/10375), we added the `onUntruncatedBlogPost` option. Use `onUntruncatedBlogPost: 'throw'` to enforce a consistent usage of [truncation markers](/docs/blog#blog-list).
## Translations
- 🇪🇪 [#10339](https://github.com/facebook/docusaurus/pull/10339): Add Estonian theme translations.
- 🇮🇩 [#10325](https://github.com/facebook/docusaurus/pull/10325): Add Indonesian theme translations.
- 🇪🇸 [#10360](https://github.com/facebook/docusaurus/pull/10360): Improve Spanish theme translations.
- 🇩🇪 [#10235](https://github.com/facebook/docusaurus/pull/10235): Improve German theme translations.
- 🇨🇳 [#10257](https://github.com/facebook/docusaurus/pull/10257): Improve Traditional Chinese (zh-Hant) theme translations.
## Other changes
Other notable changes include:
- [#10369](https://github.com/facebook/docusaurus/pull/10369): Add support for [pkg.pr.new](https://pkg.pr.new) continuous releases so that you can test any pull-request code in a StackBlitz playground.
- [#10376](https://github.com/facebook/docusaurus/pull/10376): Theme unlisted/draft banners are also shown in dev so that you don't forget to publish your content.
- [#10335](https://github.com/facebook/docusaurus/pull/10335): The Markdown top-level headings `# title` are automatically wrapped in `<header>` for consistency with front matter `title: Title`.
- [#10286](https://github.com/facebook/docusaurus/pull/10286): Allows Docusaurus plugins to self-disable by returning `null`.
- [#10241](https://github.com/facebook/docusaurus/pull/10241): Add support for [MDX processor `recmaPlugins` option](https://mdxjs.com/packages/mdx/#processoroptions) to modify the MDX Estree AST.
- [#10324](https://github.com/facebook/docusaurus/pull/10324): The docs autogenerated `_category_.json` accepts a new `description` property that gets displayed on generated index pages.
- [#10368](https://github.com/facebook/docusaurus/pull/10368): The CLI command `docusaurus --version` now actually returns the Docusaurus version.
- [#10240](https://github.com/facebook/docusaurus/pull/10240): Markdown `mdx-code-block` now supports indentation.
- [#10219](https://github.com/facebook/docusaurus/pull/10219): Fix `<TabItem lazy>` support the for `className` prop.
- [#10313](https://github.com/facebook/docusaurus/pull/10313): Blog-related `@docusaurus/theme-common/internal` APIs have been moved to `@docusaurus/plugin-content-blog/client`.
- [#10316](https://github.com/facebook/docusaurus/pull/10316): Docs-related `@docusaurus/theme-common/internal` APIs have been moved to `@docusaurus/plugin-content-docs/client`.
Check the **[3.5.0 changelog entry](/changelog/3.5.0)** for an exhaustive list of changes.