Module:首页分类

Maintenance script​(留言 | 贡献)2026年7月16日 (四) 19:19的版本 (创建首页分类气泡模块)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

此模块的文档可以在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 output = {
		'<div class="mw-mainpage-link-cloud" data-source="Module:首页分类">'
	}

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

	output[#output + 1] = '</div>'
	return table.concat( output, '\n' )
end

return p