Directory subnav polishes and wider rollout#15310
Directory subnav polishes and wider rollout#15310frederickobrien wants to merge 1 commit intomainfrom
Conversation
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
| > | ||
| <a | ||
| href={link.href} | ||
| href={`/${link.id}`} |
There was a problem hiding this comment.
Is pageId a sound way of linking internally? It seemed to work locally but wanted to double check.
There was a problem hiding this comment.
Worth discussing with @JustinPinner the differences between this vs webURL vs canonicalUrl?
This id is being set by you here in this file, in the config object? So it's a predefined list of paths that you've tested, as opposed to something coming in dynamically from upstream data?
There was a problem hiding this comment.
Exactly yeah, so we can easily change it to something else if it's more appropriate. I'm currently using the pageId value of each page.
There was a problem hiding this comment.
Have spoken with @JustinPinner about this @JamieB-gu and it seems pageId is the way to go: "the content's ID is the most stable CAPI reference you could use"
7a3e1d6 to
8a4fb64
Compare
JamieB-gu
left a comment
There was a problem hiding this comment.
Looks good, just that point you've raised about links to discuss.
8a4fb64 to
ac78fa8
Compare
ac78fa8 to
9d59bce
Compare
This makes a few adjustments to the directory subnav component. It gets the 'selected' styling working (I've tried inferring it from pageIds rather than doing the work outside the component to pass in as a 'selected' prop.
With a nod from sport I've also added the ability to render the bar based on tag, as I think there's a keenness to have this appear on all 2026 Winter Olympics pages.
More to iterate on here but have run locally and seems to work nicely.