Module:Official website: Difference between revisions

Content deleted Content added
tabs
reduce number of queries to WikiData from 2 to 1
Line 110:
 
-- Render the tracking category.
local function renderTrackingCategory(url, wikidataurl)
if mw.title.getCurrentTitle().namespace ~= 0 then
return ''
end
local category
local wikidataurl = fetchWikidataUrl()
if not url and not wikidataurl then
category = 'Official website missing URL'
Line 131 ⟶ 130:
 
function p._main(args)
local urlwikidataurl = args[1] or args.___URL or args.url or fetchWikidataUrl()
local url = args[1] or args.___URL or args.url or wikidataurl
local formattedUrl = renderUrl{
url = url,
Line 138:
format = args.format
}
return formattedUrl .. renderTrackingCategory(url, wikidataurl)
end