Skip to content

Commit 2c012d3

Browse files
committed
fix: case with readme and no rest documents
1 parent 189b03e commit 2c012d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/strategies/export-version.strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async function exportToHTML(config: ExportVersionBuildConfig, buildResult: Build
6464
const generatedHtmlExportDocuments: ExportDocument[] = []
6565
const restDocuments = documents.filter(isRestDocument)
6666
const hasReadme = !!documents.find(({ filename }) => filename.toLowerCase() === 'readme.md')
67-
const shouldAddIndexPage = restDocuments.length > 1 || hasReadme
67+
const shouldAddIndexPage = hasReadme && restDocuments.length > 0 || restDocuments.length > 1
6868
const transformedDocuments = await Promise.all(documents.map(async document => {
6969
const { createExportDocument } = apiBuilders.find(({ types }) => types.includes(document.type)) || unknownApiBuilder
7070
const file = await rawDocumentResolver(versionWithRevision, packageId, document.slug)

0 commit comments

Comments
 (0)