Defining links in a category where we can configure URL as parameter/config

AI-generated summary

The discussion revolves around defining links in a category description where the URL can be configured as a parameter. alank is looking for a way to use a configurable base_url in links, such as [{base_url}/project....], to accommodate changing URLs in different environments. pfaffman suggests using a theme component to replace text, which could work for all posts, not just category descriptions. Alternatively, pfaffman proposes using the /admin/logs/watched_words/action/censor feature to replace a word with another, which alank plans to test for replacing project_url with a specific URL in links.

If I insert via the API a URL into a Category description such as [http:something1/project… ] but in the future I might want [http:something2/project… ] , that is that the referencing url could change or not be the same in future environments, is there a config or option in Discourse to make links more like [{base_url}/project…], like a way to configure base_url as an environment variable that is replaced in all URLs?

I think you can do it with a theme component. There are some examples of how to replace text with a theme component. It would do it in all posts, not just category descriptions, but that’d probably be OK.

EDIT: Actually /admin/logs/watched_words/action/censor might do the job for you. You can have a word replaced with another one. I think that it’d work in your links, but haven’t tested it.

@pfaffman that is very interesting so for example I could have project_url in say [project_url/home_page/…] replaced to www.projects1 I’ll give it a shot and see if word replacement woerks in [urls][descriptions] or maybe there is another way of defining URLs, just going by base Meta Description format.