Documentation for this module may be created at Module:SEO/doc
local p = {}
p.__index = p
function p:addKeyword(word)
if not self.args["keywords"] then
self.args["keywords"] = {}
end
if type(word) == "table" then
for i, keyword in pairs(word) do
table.insert(self.args["keywords"],keyword)
end
else
table.insert(self.args["keywords"],word)
end
end
function p:addSiteParameters()
self.args["site_name"] = "Dovedale Railway Wiki"
self.args["locale"] = "en_EN"
self.args["title_mode"] = "replace"
self.args["title"] = self.args["title"].." - Dovedale Railway Wiki"
self.args["type"] = "wiki"
--short seo keywords
self:addKeyword{"Dovedale","Railway","Train","Station","Roblox", "game","simulator","narrowguage","wiki","wikipedia","Official","signal","signalling","play","railroad","steam"}
--long seo keywords
self:addKeyword{"dovedale wiki","dovedale railway wiki","train station","roblox game","dovedale game","dovedale narrowguage railway","model railway","steam train","railway museum",self.args.title}
end
function p:addParameter(key,value)
if value == "keywords" then
self:addKeyword(value)
else
self.args[key] = value
end
end
function p:done()
self:addSiteParameters()
self.args["keywords"] = table.concat(self.args["keywords"] or {},", ")
mw.ext.seo.set(self.args)
end
function p.new(self, parameters)
return setmetatable({args=parameters or {keywords={}}}, p )
end
return p