More actions
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
local html = mw.html.create("a") | local html = mw.html.create("a") | ||
html:attr("href", mw.uri.fullUrl(article) | html:attr("href", mw.uri.fullUrl(article):tostring()) | ||
:addClass("button-with-circle") | :addClass("button-with-circle") | ||
:tag("div") | :tag("div") |
Revision as of 07:51, 10 December 2024
Documentation for this module may be created at Module:ArticleButton/doc
local p = {}
function p.render(frame)
local args = frame:getParent().args
local article = args.article or mw.title.getCurrentTitle().fullText
local label = args.label or mw.title.new(article).text
local image = args.image or mw.ext.PageImages.getImage(article)
local html = mw.html.create("a")
html:attr("href", mw.uri.fullUrl(article):tostring())
:addClass("button-with-circle")
:tag("div")
:addClass("circle-image")
:css("background-image", "url('" .. image .. "')")
:done()
:tag("span")
:wikitext(label)
:done()
return tostring(html)
end
return p