fix(v2): sidebar_label should be used to compute next/previous button labels (#4970)

* sidebar_label should be used to compute next/previous button texts, as documented.

* improve docs frontmatter doc

* use a little bit of destructuring
This commit is contained in:
Sébastien Lorber 2021-06-15 12:04:29 +02:00 committed by GitHub
parent aeb8e9da51
commit 737f80a026
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 75 additions and 38 deletions

View file

@ -11,21 +11,7 @@ import {
JoiFrontMatter as Joi, // Custom instance for frontmatter
validateFrontMatter,
} from '@docusaurus/utils-validation';
export type DocFrontMatter = {
id?: string;
title?: string;
hide_title?: boolean;
hide_table_of_contents?: boolean;
keywords?: string[];
image?: string;
description?: string;
slug?: string;
sidebar_label?: string;
sidebar_position?: number;
custom_edit_url?: string | null;
parse_number_prefixes?: boolean;
};
import {DocFrontMatter} from './types';
// NOTE: we don't add any default value on purpose here
// We don't want default values to magically appear in doc metadatas and props