Docusaurus 2.1
We are happy to announce Docusaurus 2.1, our very first minor version release.
The upgrade should be easy: as explained in our release process documentation, minor versions respect Semantic Versioning.
精彩内容
DocCardList improvements
In #8008, we simplified the usage of the<DocCardList>
component, that is notably used on sidebar category generated index pages.
The items
prop is now optional, and will be automatically inferred from the content of the parent sidebar category:
import DocCardList from '@theme/DocCardList';
- import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
- <DocCardList items={useCurrentSidebarCategory().items}/>
+ <DocCardList/>
Also, we made it possible to use it on any document, including regular docs not linked to any sidebar category.
noindex
improvements
We improved the support of the noindex
meta robots
directive, a way to signal search engines you don't want a specific page to be indexed.
In #7963, we allow noindex
to be configured on a per-docs-version basis.
Use the following plugin options to tell crawlers you don't want the 1.0.0
version to be indexed:
const options = {
versions: {
'1.0.0': {
noIndex: true,
},
},
};
In practice, Docusaurus will add the following meta to each page of that version:
<meta name="robots" content="noindex, nofollow" />
In #7964, we also fixed a bug where the sitemap plugin would still contain pages that have a noindex
directive. Now the sitemap plugin will reliably filter out all the pages containing noindex
directives.