Skip to content

Ability to set a custom page title via _sidebar.md#557

Merged
QingWei-Li merged 2 commits intodocsifyjs:masterfrom
soulfly:custom_page_title
Jun 29, 2018
Merged

Ability to set a custom page title via _sidebar.md#557
QingWei-Li merged 2 commits intodocsifyjs:masterfrom
soulfly:custom_page_title

Conversation

@soulfly
Copy link
Contributor

@soulfly soulfly commented Jun 28, 2018

This PR introduces a new way to customize page's 'title' HTML tag.

We can provide sidebar links with titles, e.g.
* [Getting Started](ios/getting-started.md "Getting started with iOS SDK toolkit")

In this case, with this PR implementation, the "Getting started with iOS SDK toolkit" anchor title will be a title of page as well

Ref #540

Checklist:

  • Make sure you are merging your commits to master branch.
  • Add some descriptions and refer relative issues for you PR.
  • DO NOT include files inside lib directory.

@soulfly
Copy link
Contributor Author

soulfly commented Jun 28, 2018

@QingWei-Li please review

dom.$.title = target.title
}else{
dom.$.title = target ? `${target.innerText} - ${title}` : title
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dom.$.title = target ? (target.title || `${target.innerText} - ${title}`) : title

This performance is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants