fast
fast copied to clipboard
feat: add dynamic route titles in `FAST-Router`
🙋 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

Post on Medium

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