Module:SocialShare

From TwogPedia

Documentation for this module may be created at Module:SocialShare/doc

local p = {}

function p.generateShareLinks(frame)
    local socialLinks = {
        { source = "Twitter" },
        { source = "Facebook" },
        { source = "Instagram" },
        { source = "Linkedin" }
    }

    local html = mw.html.create("div"):addClass("right-last-container-news-twogpedia")
    html:tag("b"):wikitext("Share:"):done()

    for _, data in ipairs(socialLinks) do
        local span = html:tag("span"):addClass("icon-container-news-twogpedia")
        local iconHtml = "[[File:" .. data.source .. ".png|25px]]"
        span:wikitext(iconHtml)
        span:done()
    end

    return tostring(html)
end

return p