Fix title generation for index page

This commit is contained in:
Stephan Hoyer 2022-02-18 09:35:22 +01:00
parent d93cca964e
commit c7b56161a5

View file

@ -142,11 +142,12 @@ class Generator {
const title = body.match(/^#([^\n\r]+)/i) || []
let result = this._layout
result = result.replace(
/<title>Mithril\.js<\/title>/,
`<title>${title[1]} - Mithril.js</title>`
)
if (title[1]) {
result = result.replace(
/<title>Mithril\.js<\/title>/,
`<title>${title[1]} - Mithril.js</title>`
)
}
// update version
result = result.replace(/\[version\]/g, this._version)