Module:SiteList: Difference between revisions

Jump to navigation Jump to search
242 bytes added ,  22 July 2023
no edit summary
No edit summary
No edit summary
function p.site(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:SiteList'})
local site = findSite(args.site) and sites[args.site:lower()]
 
if site then
return mw.text.nowiki('{{SiteList}}') .. ' Error: invalid site parameter'
end
end
 
function findSite(argsSite)
for _, site in pairs(sites) do
for _, alias in pairs(site.aliases) do
if alias == argsSite then
return site
end
end
end
return nil
end
 

Navigation menu