Skip to content

Commit da27756

Browse files
committed
fix: readme could not be set to none in a config file
Closes #1608
1 parent bf79e32 commit da27756

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/lib/converter/plugins/PackagePlugin.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Converter } from "../converter";
66
import { Context } from "../context";
77
import { BindOption, readFile } from "../../utils";
88
import { getCommonDirectory } from "../../utils/fs";
9-
import { join } from "path";
109

1110
/**
1211
* A handler that tries to find the package.json and readme.md files of the
@@ -48,7 +47,7 @@ export class PackagePlugin extends ConverterComponent {
4847
this.packageFile = undefined;
4948

5049
// Path will be resolved already. This is kind of ugly, but...
51-
const noReadmeFile = this.readme == join(process.cwd(), "none");
50+
const noReadmeFile = this.readme.endsWith("none");
5251
if (!noReadmeFile && this.readme) {
5352
if (FS.existsSync(this.readme)) {
5453
this.readmeFile = this.readme;

src/lib/output/themes/DefaultTheme.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class DefaultTheme extends Theme {
130130
getUrls(project: ProjectReflection): UrlMapping[] {
131131
const urls: UrlMapping[] = [];
132132

133-
if (this.application.options.getValue("readme") === "none") {
133+
if (false == hasReadme(this.application.options.getValue("readme"))) {
134134
project.url = "index.html";
135135
urls.push(new UrlMapping("index.html", project, "reflection.hbs"));
136136
} else {
@@ -165,7 +165,7 @@ export class DefaultTheme extends Theme {
165165
multipleEntryPoints
166166
);
167167
return builder.build(
168-
this.application.options.getValue("readme") !== "none"
168+
hasReadme(this.application.options.getValue("readme"))
169169
);
170170
}
171171

@@ -581,3 +581,7 @@ export class NavigationBuilder {
581581
})(reflection);
582582
}
583583
}
584+
585+
function hasReadme(readme: string) {
586+
return !readme.endsWith("none");
587+
}

0 commit comments

Comments
 (0)