Module:IsRedirect

From Dive Atlas
Revision as of 05:39, 25 August 2023 by Poseidon (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:IsRedirect/doc

local i = {}
 
function i.IsRedirect(frame)
    local pagename = frame.args[1];
    if pagename == '' then
        return '';
    end
    
    local page = mw.title.new(pagename);
    if page.isRedirect then
        return 'yes';
    else
        return '';
    end
end
 
return i;