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

Viewed 17

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 Answers
Related