跳转到内容

Module:首页分类

来自陋室
Maintenance script​(留言 | 贡献)2026年7月16日 (四) 19:21的版本 (修正首页分类气泡模块输出结构)

此模块的文档可以在Module:首页分类/doc创建

local p = {}

local categories = {
	{ title = '云计算与大数据', label = '云计算与大数据' },
	{ title = 'Python 后端开发', label = 'Python 后端开发' },
	{ title = 'Java 后端开发', label = 'Java 后端开发' },
	{ title = '软件测试', label = '软件测试' },
	{ title = 'Web 前端开发', label = 'Web 前端开发' },
	{ title = '物联网应用技术', label = '物联网应用技术' },
	{ title = 'AIGC', label = 'AIGC' },
	{ title = '通信技术', label = '通信技术' },
}

function p.bubbles()
	local links = {}

	for _, category in ipairs( categories ) do
		links[#links + 1] = string.format(
			'[[:Category:%s|%s]]',
			category.title,
			category.label
		)
	end

	return '<div class="mw-mainpage-link-cloud" data-source="Module:首页分类">' ..
		table.concat( links, ' ' ) ..
		'</div>'
end

return p