Jump to content

Module:MainPageNupe

Dagan Wikipedia

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

local p = {}

function p.main(frame)
    local sections = {
        ["Happening Right Now"] = frame.args[1] or "Latest updates and events happening in real-time.",
        ["Trending"] = frame.args[2] or "Most-read articles and popular discussions.",
        ["In the News"] = frame.args[3] or "Major headlines relevant to the Nupe community and beyond.",
        ["On This Day"] = frame.args[4] or "Historical events, anniversaries, and significant dates."
    }

    local content = mw.html.create('div')
        :addClass('main-page-container')

    for title, text in pairs(sections) do
        content:node(mw.html.create('div')
            :addClass('main-page-section')
            :node(mw.html.create('h2'):wikitext(title))
            :node(mw.html.create('p'):wikitext(text)))
    end

    return tostring(content)
end

return p