Skip to content

feat(v2): add ability to set custom title delimiter in config#3460

Merged
lex111 merged 7 commits intofacebook:masterfrom
Simek:add-custom-title-delimiter
Sep 25, 2020
Merged

feat(v2): add ability to set custom title delimiter in config#3460
lex111 merged 7 commits intofacebook:masterfrom
Simek:add-custom-title-delimiter

Conversation

@Simek
Copy link
Contributor

@Simek Simek commented Sep 18, 2020

Motivation

Currently in the theme classics the generated title delimiter is hardcoded. This small PR adds a field to the themeConfig which allows the user to specify their own delimiter character or even a string.

This PR includes the small mention in the documentation and fixes few minor issues in the code blocks on theme classics page.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Feature has been tested with the local run of Docusaurus V2 website.

Preview

Screenshot 2020-09-17 222502

Related PRs

None

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 18, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Sep 18, 2020

Deploy preview for docusaurus-2 ready!

Built without sensitive environment variables with commit b853add

https://deploy-preview-3460--docusaurus-2.netlify.app

Copy link
Contributor

@lex111 lex111 left a comment

Choose a reason for hiding this comment

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

ci/circleci: tests — Your tests failed on CircleCI

It seems that tests snapshots need to be updated.

@Simek
Copy link
Contributor Author

Simek commented Sep 22, 2020

It seems that tests snapshots need to be updated.

@lex111 It is currently not possible on Windows due to many paths issues, I need to clone this branch and regenerate snapshots on macOS. 😉

Screenshot 2020-09-22 191427

@Simek
Copy link
Contributor Author

Simek commented Sep 24, 2020

@lex111 I have updated the validation tests results. 🙂

@lex111
Copy link
Contributor

lex111 commented Sep 24, 2020

Hmm, I just thought, why does the delimiter param relates to the theme config, if it should rather be in the site config? Wouldn't it be better to move this parameter to the site config?

@Simek
Copy link
Contributor Author

Simek commented Sep 24, 2020

@lex111 THB I'm focusing my efforts on the theme-classic package (as title suggest), most of my recent PRs came to fruition because of migration issues to V2 or missing features in comparison to V1. I also want to keep my changesets as small as possible to speed up the review process and avoid unnecessary issues.

I have no interest in other themes (ie. theme-bootstrap), the goal is to migrate the React Native website (and I'm doing it in my free time), but if you think that the lack of similar changes in other themes is a blocker I will try to port/rewrite the changes for them.

@lex111
Copy link
Contributor

lex111 commented Sep 24, 2020 via email

@Simek Simek requested a review from lex111 September 25, 2020 14:20
@Simek Simek changed the title feat(v2): add custom title delimiter support to the theme classic feat(v2): add ability to set custom title delimiter in config Sep 25, 2020
@lex111 lex111 merged commit c0d8238 into facebook:master Sep 25, 2020
@lex111
Copy link
Contributor

lex111 commented Sep 25, 2020

@Simek awesome thing, thank you a lot!

@lex111 lex111 added this to the v2.0.0-alpha.65 milestone Sep 26, 2020
slorber pushed a commit that referenced this pull request Sep 29, 2020
* feat(v2): add custom title delimiter to the theme classic

* fix validation tests

* remove title delimiter fallback

* move titleDelimiter to main config, update theme-bootstrap

* remove test value from config

* update test snapshot

* Improve docs

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants