mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
Add optional sidebar_title docs front matter field for sidebar titles distinct from document article titles
This commit is contained in:
parent
523d824651
commit
eccbc178e5
3 changed files with 20 additions and 7 deletions
|
@ -69,12 +69,20 @@ class SideNav extends React.Component {
|
|||
return categoryString;
|
||||
}
|
||||
getLocalizedString(metadata) {
|
||||
let localizedString = translation[this.props.language]
|
||||
? translation[this.props.language]["localized-strings"][
|
||||
metadata.localized_id
|
||||
] || metadata.title
|
||||
: metadata.title;
|
||||
|
||||
let localizedString;
|
||||
if (metadata.sidebar_title) {
|
||||
localizedString = translation[this.props.language]
|
||||
? translation[this.props.language]["localized-strings"][
|
||||
metadata.sidebar_title
|
||||
] || metadata.sidebar_title
|
||||
: metadata.sidebar_title;
|
||||
} else {
|
||||
localizedString = translation[this.props.language]
|
||||
? translation[this.props.language]["localized-strings"][
|
||||
metadata.localized_id
|
||||
] || metadata.title
|
||||
: metadata.title;
|
||||
}
|
||||
return localizedString;
|
||||
}
|
||||
getLink(metadata) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue