Module:SocialMedia: Difference between revisions
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
-- | -- Lines 5 and 6 get transcluded based on their position in this Module, so do not move them! | ||
-- Currently supported platforms are: | -- Currently supported platforms are: | ||
-- Facebook, Instagram, LinkedIn, Telegram, Threads, TikTok, X/Twitter, Youtube | -- Facebook, Instagram, LinkedIn, Telegram, Threads, TikTok, X/Twitter, Youtube | ||
-- (Update | -- (Update Line 6 as plaforms get added or removed) | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
-- | -- ! ONLY START EDITING FROM THIS POINT ONWARDS ! | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
| Line 57: | Line 57: | ||
}, | }, | ||
{ | { | ||
param = { "x", "twitter" }, | param = { "x", "twitter" }, | ||
icon = "File:SocialXIcon.svg", | icon = "File:SocialXIcon.svg", | ||
| Line 71: | Line 70: | ||
} | } | ||
-- Helper to find the first non-empty user handle from a param or table of params | -- Helper to find the first non-empty user handle from a param or table of params | ||
local function getUserHandle(args, param) | local function getUserHandle(args, param) | ||
local handle | local handle | ||
| Line 92: | Line 87: | ||
end | end | ||
-- Build a clickable icon link (24px) with alt text for accessibility: | -- Build a clickable icon link (24px) with alt text for accessibility: [[File:Something.svg|24px|alt=ALT_TEXT|link=URL]] | ||
local function buildIconLink(iconFile, altText, url) | local function buildIconLink(iconFile, altText, url) | ||
return string.format("[[%s|24px|alt=%s|link=%s]]", iconFile, altText, url) | return string.format("[[%s|24px|alt=%s|link=%s]]", iconFile, altText, url) | ||