Module:SiteList
Jump to navigation
Jump to search
Documentation for this module may be created at Module:SiteList/doc
local p = {} local siteDB = require('Module:SiteDatabase') function p.siteList(frame) local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:SiteList'}) local site = args.site local id = args.id or '' local sceneid = args.sceneid or '' local alias = args.alias or mw.title.getCurrentTitle().text local notes = args.notes or 'N/A' local siteData = siteDB.sites[site] if siteData then local url = siteData.default_url if id ~= '' then url = siteData.model_url:gsub('MODEL_ID', id) elseif sceneid ~= '' then url = siteData.scene_url:gsub('SCENE_ID', sceneid) end local link = '[' .. url .. ' ' .. site .. '] <small>(' .. siteData.category .. ')</small>' if mw.title.getCurrentTitle().namespace == 0 then link = link .. siteData.model_category end return link else return 'None' end end return p