Module:Vital article: Difference between revisions

Content deleted Content added
check parameter is not blank
use getLink function
Line 1:
local p = {}
 
p.linklocal getLink = function(framepage)
local page = frame.args.page~='' and frame.args.page or mw.title.getCurrentTitle().subjectPageTitle.text
local subpage = mw.ustring.upper(mw.ustring.sub(page, 1, 1)) -- get first letter of article name
local codepoint = mw.ustring.codepoint(page, 1, 1)
Line 26 ⟶ 25:
link = link .. '[[Category:Wikipedia vital articles with an incorrect link]]'
end
return link, level
return '[[' .. page .. ']] [[File:Círculos Concéntricos.svg|16px|link=|alt=]] [[' .. link .. '|' .. level .. ']]'
end
end
end
 
p.link = function(frame)
local page = frame.args.page~='' and frame.args.page or mw.title.getCurrentTitle().subjectPageTitle.text
local link, level = getLink(page)
return '[[' .. page .. ']]' .. (link and ' [[File:Círculos Concéntricos.svg|16px|link=|alt=]] [[' .. link .. '|' .. level .. ']]' or '')
end