Feature summary:
Create a new magic word that pulls a redirect's target page.
Note that this should also work with JavaScript redirects (which have different syntax) and Vue redirects (after T401158: Enable redirects for Vue components)
- {{#redirecttarget}} returns a page's redirect target
- {{#redirecttarget:escaped}} returns a page's redirect target (I think this is the right syntax?) for use in URLs.
- {{#redirecttarget:link}} returns a link to the page [[like this]].
- {{#redirecttarget:linktitle}} returns a link to the page BUT uses the page's title (which may have been altered by {{DISPLAYTITLE}}) -- [[like this|''like this'']] -- this would probably be dependent on fixing the issues in T379525: Add a magic word that returns the page title, which may be set by {{DISPLAYTITLE}} or default to page name. This would be a little redundant, given it would be possible to pull this with some code using T386673: magic word {{#isredirect}} and T379525: Add a magic word that returns the page title, which may be set by {{DISPLAYTITLE}} or default to page name.
Benefits:
Although Lua/Scribunto can probably perform a similar task, it runs into the objection that (1) 3rd party wikis may not have Lua/Scribunto installed, and that this would be useful for core (default) system messages. In particular, cross-namespace redirects might be tested for.
And I think it might be useful for Semantic MediaWiki as well.