Skip to content

Commit

Permalink
Fix title generation for index page
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanHoyer committed Feb 18, 2022
1 parent b195a6f commit 1f4180a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/generate-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,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)
Expand Down

0 comments on commit 1f4180a

Please sign in to comment.