Module:Find sources: Difference between revisions

Jump to navigation Jump to search
m (1 revision imported)
Line 5: Line 5:
local ROOT_PAGE = 'Module:Find sources'
local ROOT_PAGE = 'Module:Find sources'
local TEMPLATE_ROOT = ROOT_PAGE .. '/templates/' -- for template config modules
local TEMPLATE_ROOT = ROOT_PAGE .. '/templates/' -- for template config modules
local LINK_ROOT = ROOT_PAGE .. '/links/' -- for link config modules
local LINK_CONFIG = ROOT_PAGE .. '/links' -- for link config modules
local CONFIG_PAGE = ROOT_PAGE .. '/config' -- for global config
local CONFIG_PAGE = ROOT_PAGE .. '/config' -- for global config


Line 45: Line 45:


-- Get link config.
-- Get link config.
local linkCfg = maybeLoadData(LINK_ROOT .. code)
local links = maybeLoadData(LINK_CONFIG)
local linkCfg = links[code]
if not linkCfg then
if not linkCfg then
error(string.format(
error(string.format(
"invalid link code '%s'; no link config found at [[%s]]",
"invalid link code '%s'; no link config found at [[%s]]",
code,
code,
LINK_ROOT .. code
LINK_CONFIG
))
))
end
end