I enjoy using Discourse feature that automatically converts watched words into links. However, I’m also looking for a way to auto-convert external links, primarily to insert affiliate links (other than Amazon). I attempted to achieve this using the regex option in watched words, but it doesn’t seem to work for links. Does anyone have any suggestions?
It looks that way to me too. I created a replacement for https://www.digitalocean.com/ → https://m.do.co/c/a5bf212d9a92/ and if enable markdown linkify is on, it doesn’t work, and if it’s off, it does. What I’d really like is for it to re-write the link.
That’s likely overkill. If you just want to rewrite some urls, you don’t need much. I have a theme component that rewrites one boxes.
I have a theme component that finds one-boxes from a certain domain and rewrites them as <iframes> appropriate to that site. It shouldn’t be too hard (for someone with skills as meager as mine) to change it to re-write your links.
The main difference with an approach like Discourse Affiliate’s is that it changes the link in the cooked content, so it will also work outside the web application, like in emails or if using a different client (very, very rare). Just something to be aware of.