Module:Redirect template: Difference between revisions

Sync from sandbox, add draft namespace
 
Created page with "require('strict') local p = {} -- key is beginning of arg name. value is table with namespace number and link -- alternatively, a function taking the namespace number and returning a validity -- can be used local namespaceCategories = { all = { function() return true end }, main = { 0, 'main' }, help = { 12, 'help' }, portal = { 100, 'portal' }, talk = { function(n) return n > 0 and n%2 == 1 end, '[[Help:Talk pa..."
Line 8: Line 8:
local namespaceCategories = {
local namespaceCategories = {
all = { function() return true end },
all = { function() return true end },
main = { 0, '[[wp:mainspace|main]]' },
main = { 0, '[[cp:mainspace|main]]' },
help = { 12, '[[wp:help namespace|help]]' },
help = { 12, '[[cp:help namespace|help]]' },
portal = { 100, '[[wp:portal|portal]]' },
portal = { 100, '[[cp:portal|portal]]' },
talk = { function(n) return n > 0 and n%2 == 1 end, '[[Help:Talk pages|talk]]' },
talk = { function(n) return n > 0 and n%2 == 1 end, '[[Help:Talk pages|talk]]' },
template = { 10, '[[wp:template namespace|template]]' },
template = { 10, '[[cp:template namespace|template]]' },
wikipedia = { 4, '[[wp:project namespace|Wikipedia project]]' },
wikipedia = { 4, '[[cp:project namespace|Wikipedia project]]' },
category = { 14, '[[wp:categorization|category]]' },
category = { 14, '[[cp:categorization|category]]' },
user = { 2, '[[wp:user pages|user]]' },
user = { 2, '[[cp:user pages|user]]' },
draft = { 118, '[[wp:drafts|draft]]' },
draft = { 118, '[[cp:drafts|draft]]' },
}
}