Gatsby plugin to add params to all outbound links in mdx?

35 Views Asked by At

I’d like to automatically modify all outbound links in the .mdx. If the url matches a particular pattern, add a url param.

given pattern=mycompany.com

[Company Page](https://mycompany.com/path) should become [Company Page](https://mycompany.com/path?trackingId=xxxxxx)

or direct JSX

<a href=“https://mycompany.com/path2?param=something&trackingId=xxxxxx” />

Could this be a plugin that only modifies all urls upon build, like prefixPath (?)

0

There are 0 best solutions below