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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add dynamic route titles in FAST-Router #6325

Open
KingOfTac opened this issue Aug 26, 2022 · 1 comment
Open

feat: add dynamic route titles in FAST-Router #6325

KingOfTac opened this issue Aug 26, 2022 · 1 comment
Labels
area:fast-router Pertains to fast-router

Comments

@KingOfTac
Copy link
Collaborator

馃檵 Feature Request

A nice feature I think would be the ability to interpolate route parameters into the title.

馃 Expected Behavior

The ability to do something like this:

{ path: 'products/{productName}', title: '{productName}' }

馃槸 Current Behavior

The above code would produce "{productName}" as the page title.

馃拋 Possible Solution

Since this is all happening in the route mapping, I think all that is required is to check if the childTitle contains a match for the route parameter and interpolate the value. Much like it already does for the path.

馃敠 Context

A common pattern for things like products and blog posts is to set the page title to the title of the product or post in addition to some other text.

馃捇 Examples

Newegg product listing
image

Post on Medium
image

@KingOfTac KingOfTac added status:triage New Issue - needs triage area:fast-router Pertains to fast-router labels Aug 26, 2022
@KingOfTac KingOfTac self-assigned this Aug 26, 2022
@KingOfTac KingOfTac removed the status:triage New Issue - needs triage label Aug 26, 2022
@KingOfTac
Copy link
Collaborator Author

I self-assigned this; however, I'd like to get other people's thoughts on the feature before starting on anything.

@KingOfTac KingOfTac removed their assignment Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fast-router Pertains to fast-router
Projects
None yet
Development

No branches or pull requests

1 participant