Module:Official website: Difference between revisions

Content deleted Content added
m call mw.getCurrentFrame properly
wrap pcall to make it easier to use, seeing as we will probably be calling it multiple times and we don't need the error messages
Line 5:
local function makeCategory(s)
return string.format('[[Category:%s]]', s)
end
 
local function quickPcall(func)
local success, result = pcall(func)
if not success then
return result
end
end
 
local fetchWikidataUrl
fetchWikidataUrl = function()
local success, url = pcallquickPcall(function ()
return mw.wikibase.getEntityObject().claims.P856[1].mainsnak.datavalue.value
end)
if not success then
url = nil
end
fetchWikidataUrl = function ()
return url