Module:GameLanding/Menu

From TwogPedia

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

local p = {}

function p.main(frame)
	local game = mw.text.split(mw.title.getCurrentTitle().text, '/')[1]
	
	local menu = mw.html.create('div'):addClass('game__menu')
	
	--Menu
	local menuItems = {
		{text = 'Overview', link = game},
		{text = 'People', link = game .. '/People'},
		{text = 'Teams', link = game .. '/Teams'},
		{text = 'Tournaments', link = game .. '/Tournaments'},
		{text = 'Transfers', link = game .. '/Transfers'},
	}
	for _, item in ipairs(menuItems) do
		menu:node(mw.html.create():wikitext('[[' .. item.link .. '|' .. item.text .. ']]'))
	end
	
	return menu
end

return p