Module:Redirect and target

MyWikiBiz, Author Your Legacy — Saturday October 05, 2024
Revision as of 05:37, 16 July 2021 by Zoran (talk | contribs) (Pywikibot 6.4.0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Documentation for this module may be created at Module:Redirect and target/doc

local getTarget = require('Module:Redirect').getTarget
local p = {}

function p.line(frame)
	local pageTitle = frame.args[1]
	local target = getTarget(pageTitle)
	if target then
   	        return string.format('[[%s]] → [[%s]]', pageTitle, target)
	end
	return string.format('[[%s]] is not a redirect', pageTitle)
end

return p