17,230
edits
m (fix a couple errors) |
m (fix another error) |
||
Line 23: | Line 23: | ||
local groups = { default = {} } | local groups = { default = {} } | ||
for _, page in ipairs( pages ) do | for _, page in ipairs( pages ) do | ||
-- remove extra from sortkey | -- remove extra from sortkey | ||
if page.extra then page.sortkey = string.sub( page.sortkey, 1, -string.len( page.extra ) - 2 ) end | if page.extra then page.sortkey = string.sub( page.sortkey, 1, -string.len( page.extra ) - 2 ) end | ||
Line 35: | Line 34: | ||
-- add page to group | -- add page to group | ||
page.args.group = page.extra or 'default' | |||
page.__index = page -- allow variants to fall back to page | page.__index = page -- allow variants to fall back to page | ||
page.args.__index = page.args -- allow variants' args to fall back to page's args | page.args.__index = page.args -- allow variants' args to fall back to page's args |