Why isn't this handled in the page or post via `permalink` or something? Why don't you just want the URL?