mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-07 12:47:49 +00:00
fix: handle htmlTemplate option for build-docs command (#1071)
This commit is contained in:
@@ -37,7 +37,7 @@ export function getObjectOrJSON(
|
||||
break;
|
||||
default: {
|
||||
if (config) {
|
||||
process.stderr.write(`Found ${config.configFile} and using theme.openapi options`);
|
||||
process.stderr.write(`Found ${config.configFile} and using theme.openapi options\n`);
|
||||
|
||||
return config.theme.openapi ? config.theme.openapi : {};
|
||||
}
|
||||
@@ -70,7 +70,11 @@ export async function getPageHTML(
|
||||
const state = await store.toJS();
|
||||
const css = sheet.getStyleTags();
|
||||
|
||||
templateFileName = templateFileName ? templateFileName : join(__dirname, './template.hbs');
|
||||
templateFileName = templateFileName
|
||||
? templateFileName
|
||||
: redocOptions?.htmlTemplate
|
||||
? (redocOptions.htmlTemplate as string)
|
||||
: join(__dirname, './template.hbs');
|
||||
const template = compile(readFileSync(templateFileName).toString());
|
||||
return template({
|
||||
redocHTML: `
|
||||
|
||||
Reference in New Issue
Block a user