Module:Wy/si/IsRedirect

Example Usage

edit
Page Code Result
Winter sports {{#invoke:Wy/si/IsRedirect|IsRedirect|Winter sports}}
Winter sport {{#invoke:Wy/si/IsRedirect|IsRedirect|Winter sport}}


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;