Moduldokumentasjon
local h = {}

function h.sitelink(frame)

	-- First argument is the site code ('enwiki', 'commonswiki', ...)
	local siteId = frame.args[1]
	
	-- Get Wikibase item connected to the current page
	local entity = mw.wikibase.getEntityObject()
	if not entity then
		return nil -- no wikidata page for current item
	end

	-- Get title the item is linked with in the given site
	return entity:getSitelink(siteId)
end

return h