diff --git a/docs/api-doc-markdown.md b/docs/api-doc-markdown.md index 78cf9f9e4c3a..a4b7d438c4ae 100644 --- a/docs/api-doc-markdown.md +++ b/docs/api-doc-markdown.md @@ -17,7 +17,7 @@ Documents use the following markdown header fields that are enclosed by a line ` `hide_title`: Whether to hide the title at the top of the doc. -`sidebar_label`: The text shown in the document sidebar for this document. If this field is not present, the document's `sidebar_label` will default to its `title`. +`sidebar_label`: The text shown in the document sidebar and in the next/previous button for this document. If this field is not present, the document's `sidebar_label` will default to its `title`. For example: diff --git a/v1/lib/core/DocsLayout.js b/v1/lib/core/DocsLayout.js index 865ef7b47f0e..1cd86a53e82d 100644 --- a/v1/lib/core/DocsLayout.js +++ b/v1/lib/core/DocsLayout.js @@ -60,11 +60,23 @@ class DocsLayout extends React.Component { const hasOnPageNav = this.props.config.onPageNav === 'separate'; const previousTitle = + idx(i18n, [ + 'localized-strings', + 'docs', + metadata.previous_id, + 'sidebar_label', + ]) || idx(i18n, ['localized-strings', 'docs', metadata.previous_id, 'title']) || idx(i18n, ['localized-strings', 'previous']) || metadata.previous_title || 'Previous'; const nextTitle = + idx(i18n, [ + 'localized-strings', + 'docs', + metadata.next_id, + 'sidebar_label', + ]) || idx(i18n, ['localized-strings', 'docs', metadata.next_id, 'title']) || idx(i18n, ['localized-strings', 'next']) || metadata.next_title ||