Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jun 29, 2018

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