Module:PersonPage

From The Seven Sages of Rome
Revision as of 17:25, 14 March 2025 by Noeth (talk | contribs)

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

local p = {}

function p.render(frame)
    local args = frame:getParent().args
    local canonicalName = args['Has Canonical Name']

    if canonicalName and canonicalName ~= '' then
        -- Return the redirect
        if frame.args['returnIsRedirect'] == '1' then
            return '1'
        end
        return '#REDIRECT [[' .. canonicalName .. ']]'
    end

    -- Return normal behavior
    if frame.args['returnIsRedirect'] == '1' then
        return '0'
    end

    return ''
end

return p