Module:LatestEditedPage: Difference between revisions

From Fonline The Long Journey Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 11: Line 11:
     end
     end


     return string.format('[[%s|Latest Edited Page]]', title)
     return frame:preprocess(string.format('[[%s|Latest Edited Page]]', title))
 
end
end


return p
return p

Latest revision as of 23:38, 9 March 2026

local p = {}

function p.main()

   local frame = mw.getCurrentFrame()
   local rc = frame:expandTemplate{ title = 'Special:RecentChanges', args = { '1' } }
   -- extract the first link from the RecentChanges output
   local title = rc:match('%[%[([^|%]]+)')
   if not title then
       return 'No recent edits'
   end
   return frame:preprocess(string.format('Latest Edited Page', title))

end

return p