Module:Blog

-- -- This module implements Template:Blog. local p = {} function p._main(args) local ret = {} local function add(v) ret[#ret + 1] = v	end -- Validate positional args for i = 1, 5 do		args[i] = args[i] or string.format('', i)	end -- Build the citation if args.official then add('') else add('') end add(' ') if args.official then if args.int then if args.new then add(string.format( "\"%s,\" The Official Star Wars Blog " .. ' (link) ', args.int, args[2], args.new ))			else add(string.format( "\"%s,\" The Official Star Wars Blog " .. ' (link) ', args.int, args[2], args[1] ))			end else if args.new then add(string.format( '"%s," ' .. "The Official Star Wars Blog" .. ' (archive) ', args[1], args[2], args.new ))			else add(string.format( '"%s," ' .. "The Official Star Wars Blog", args[1], args[2] ))			end end else if args.listing then add(string.format( "%s, %s's", args.archivedate and args.archivedate .. '/' or '', args[1], args[2], args[3] ))		elseif args.webcite then add(string.format( '"%s" – ' .. "%s, %s's", args.webcite, args[3], args[1], args[4], args[5] ))		else add(string.format( '"%s" – ' .. "%s, %s's", args.archivedate and args.archivedate .. '/' or '', args[1], args[2], args[3], args[1], args[4], args[5] ))		end local archiveService = args.webcite and 'WebCite' or 'Archive.org' add(string.format( ' StarWars.com Blog ' .. ' (innehållet kan numera vara föråldrard; backuplänk finns på %s) ', archiveService ))	end return string.format(		' %s ',		table.concat(ret)	) end function p.main(frame) local args = {} for k, v in pairs(frame:getParent.args) do		v = v:match('^%s*(.-)%s*$') -- trim whitespace if v ~= '' then args[k] = v		end end return p._main(args) end return p --