Skip to content

Commit 86c816a

Browse files
committed
Cache the site title
1 parent 12ba405 commit 86c816a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,11 @@ function buildIndex (files, ms, done) {
137137
} else {
138138
const mainReadme = findMatch(files, /^README.md$/i)
139139
if (!mainReadme) {
140-
var err = new Error(`Table of contents not found ('${docs}/README.md') and no README.md found`)
140+
const err = new Error(`Table of contents not found ('${docs}/README.md') and no README.md found`)
141141
return done(err)
142142
}
143-
let title = inferTitle(files[mainReadme].contents)
143+
const contents = files[mainReadme].contents.toString()
144+
const title = m(['inferTitle', contents], () => inferTitle(contents))
144145
readmeData = `* **[${title}](/${mainReadme})**`
145146
}
146147

0 commit comments

Comments
 (0)