Module:Category described in year/sandbox: Difference between revisions

Content deleted Content added
m Rename map -> conf due to increase in scope
Use 'tocmin' to specify cat size to place {{Category TOC}} on (set to 401, since each cat page displays 200)
Line 13:
]]--
['tocmin'] = 401, --integer; minimum category size to place {{Category TOC}} on
['Fish'] = { --group
Line 87 ⟶ 89:
local nav = nil
local description = nil
local toc = nil
local categories = {}
local trackingCategories = {
Line 146 ⟶ 149:
if currYear then description = mw.ustring.gsub(description, '%%year%%', currYear)
else description = mw.ustring.gsub(description, '%%year%%', 'this year') end
end
if mw.site.stats.pagesInCategory(currCat, 'pages') >= conf['tocmin'] then --expensive
toc = frame:expandTemplate{ title = 'Category TOC' }
end
Line 211 ⟶ 217:
if description and description ~= '' then header = header .. '<br />' .. description end
header = mw.text.trim(header)
if toc then header = header .. '<br />' .. toc end
--append header to outString