In a Support discussion titled How to add%{post_url} in customize URL, McFlyPartages asks if it’s possible to dynamically insert the current post’s URL into a new topic’s body via a custom URL link. simon explains that while Discourse’s built-in “Reply as linked topic” feature achieves this, manually constructing such a URL requires URL-encoding the target post’s URL (e.g., converting https://meta.discourse.org/t/... to https%3A%2F%2Fmeta...) and inserting it into the body parameter. He notes that spaces in titles must also be encoded to ensure the link remains clickable. McFlyPartages asks if a single dynamic link with a variable (like %{post_url}) could work, but simon confirms this isn’t natively supported — though such functionality could be added via a theme component or plugin. McFlyPartages thanks him for the clarification. The core takeaway: dynamic post URL insertion isn’t built-in, but achievable with manual URL encoding or custom development.
It sounds like you are trying to achieve something similar to the Discourse “Reply as linked topic” functionality. Users can do that by selecting that option from the composer’s reply-options menu:
You could also achieve that by using the compose topic via URL method that you have linked to. To get that to work, you will need to urlencode the topic’s URL before adding it to the body section of the URL. For example, if you wanted to create a link that added this topic’s URL (https://meta.discourse.org/t/how-to-add-post-url-in-customize-url/176935) to the body of a new topic, you would need to urlencode it to https%3A%2F%2Fmeta.discourse.org%2Ft%2Fhow-to-add-post-url-in-customize-url%2F176935 before adding it to the URL’s body section.
If you use that method, you will probably find that you need to URL encode the other parts of the URL to remove any spaces in it’s title. Otherwise it will not create a clickable URL.
No, there is not a way to substitute a link into a post_url variable. Possibly something that did that could be developed as a theme component or a plugin.