Module:Find sources: Difference between revisions
Jump to navigation
Jump to search
Richardpruen (talk | contribs) m (1 revision imported) |
(synced changes from /sandbox per Wikipedia:Templates for discussion/Log/2021 November 27#Module:Find sources/links/archive.org) |
||
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 | 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 | 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_CONFIG | |||
)) | )) | ||
end | end |