Content added Content deleted
mNo edit summary |
(add seo) |
||
Line 2: | Line 2: | ||
local StoryInfo = require('Module:Story info')._main |
local StoryInfo = require('Module:Story info')._main |
||
local utils = require('Module:Utilities') |
local utils = require('Module:Utilities') |
||
local SEO = mw.ext.seo |
|||
local p = {} |
local p = {} |
||
Line 28: | Line 29: | ||
args['title'] = title |
args['title'] = title |
||
if mw.title.getCurrentTitle().namespace == 0 then |
|||
SEO.set{ |
|||
title = string.format( |
|||
"Chapter %s: %s", |
|||
chapter, |
|||
english or japanese |
|||
), |
|||
title_mode = 'prepend', |
|||
} |
|||
end |
|||
return StoryInfo(args) |
return StoryInfo(args) |
Revision as of 01:17, 22 April 2022
This module depends on the following other modules: |
This module uses the following Cargo tables: |
To generate {{Event story chapter info}}, invoke using the main function.
local getArgs = require('Module:Arguments').getArgs
local StoryInfo = require('Module:Story info')._main
local utils = require('Module:Utilities')
local SEO = mw.ext.seo
local p = {}
function p.main(frame)
local args = getArgs(frame)
local chapter = args['chapter']
local english = args['english']
local japanese = args['japanese']
local romaji = args['romaji']
local title = string.format(
"Chapter %s: %s",
utils.editIfNil(chapter),
utils.editIfNil(english)
)
if japanese or romaji then
title = title .. string.format(
"<br>%s (%s)",
utils.editIfNil(japanese),
utils.editIfNil(romaji)
)
end
args['title'] = title
if mw.title.getCurrentTitle().namespace == 0 then
SEO.set{
title = string.format(
"Chapter %s: %s",
chapter,
english or japanese
),
title_mode = 'prepend',
}
end
return StoryInfo(args)
end
return p