Module:SiteList: Difference between revisions

202 bytes removed ,  23 July 2023
no edit summary
No edit summary
No edit summary
if site then
local url = site.url
if url ~= '' then
if args.sceneid and site.sceneUrl ~= '' then
url = site.sceneUrl .. args.sceneid .. site.suffix
elseif args.id and site.modelUrl ~= '' then
url = site.modelUrl .. args.id .. site.suffix
end
end
 
local isArchived = site.archived and (site.archived == 'yes' or site.archived == 'y')
local linkOrLabelarchiveNotice = linkOrLabelisArchived ..and " <small>(''Website archived'')</small>" or ''
--if CheckisArchived ifand thesite.archiveURL and site.archiveURL ~= is'' archivedthen
if isArchived then url = site.archiveURL
elseif if site.archiveURL and site.archiveURL ~= ''isArchived then
url = site.archiveURL''
else
if url ~= site.label'' then
if args.sceneid and site.sceneUrl ~= '' then
url = site.sceneUrl .. args.sceneid .. site.suffix
elseif args.id and site.modelUrl ~= '' then
url = site.modelUrl .. args.id .. site.suffix
if url ~= '' then end
end
end
local alias = args.alias or '<div style="font-size: 1em;">' .. mw.title.getCurrentTitle().text .. '</div>'
local notes = args.notes and '<div style="font-size: 1em;">' .. args.notes .. '</div>' or '<div style="font-size: 1em;">N/A</div>'
local categoryLink = site.network and site.network ~= '' and string.format(' <small>([[:Category:%s|%s]])</small>', site.network, site.network) or ''
local siteType = site.type or args[1]
local endstyle
 
local style
local siteType = site.type or args[1]
if siteType == nil or siteType == '' then
siteType = 'Invalid type'
local linkOrLabel
if url ~= '' then
-- Check if we should add the ID to the number
if site.idtonum and (site.idtonum == 'yes' or site.idtonum == 'y') and args.id then
linkOrLabel = string.format('[%s %s #%s]%s', url, site.label, args.id, archiveNotice)
else
linkOrLabel = string.format('[%s %s]%s', url, site.label, archiveNotice)
end
-- Check if the site is archived
if isArchived then
linkOrLabel = linkOrLabel .. " <small>(''Website archived'')</small>"
end
else
linkOrLabel = site.label .. archiveNotice
end
 
-- Check if we should add a link to a list
if site.list and site.list ~= '' then
linkOrLabel = linkOrLabel .. string.format(' ([[%s|LIST]])', site.list)