From 413e0dc4636a4cfe38adf1c71a40f2753b1b2e8f Mon Sep 17 00:00:00 2001 From: Maxence Harm Date: Wed, 21 Nov 2018 13:32:00 +0100 Subject: [PATCH 1/2] feat: use 'sidebar_label' instead of 'title' in prev/next buttons --- v1/lib/core/DocsLayout.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 || From fcbf1b32cf80106422c5c7d345ccf2328f39320b Mon Sep 17 00:00:00 2001 From: Maxence Harm Date: Thu, 22 Nov 2018 11:33:49 +0100 Subject: [PATCH 2/2] docs: update 'sidebar_label' description --- docs/api-doc-markdown.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: