docs: explain more clearly the purpose of a ref sidebar type (#7159)

This commit is contained in:
Andrew Lyons 2022-04-12 15:59:41 +08:00 committed by GitHub
parent d2082ba49b
commit ec109737e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,6 +118,8 @@ The pagination label by default is the sidebar label. You can use the front matt
The `ref` type is identical to the [`doc` type](#sidebar-item-doc) in every way, except that it doesn't participate in generating navigation metadata. It only registers itself as a link. When [generating pagination](#generating-pagination) and [displaying sidebar](#sidebar-association), `ref` items are completely ignored.
It is particularly useful where you wish to link to the same document from multiple sidebars. The document only belongs to one sidebar (the one where it's registered as `type: 'doc'` or from an autogenerated directory), but its link will appear in all sidebars that it's registered in.
Consider this example:
```js title="sidebars.js"