mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-10 04:21:20 +00:00
fix: handle htmlTemplate option for build-docs command (#1071)
This commit is contained in:
@@ -37,7 +37,7 @@ export function getObjectOrJSON(
|
|||||||
break;
|
break;
|
||||||
default: {
|
default: {
|
||||||
if (config) {
|
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 : {};
|
return config.theme.openapi ? config.theme.openapi : {};
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,11 @@ export async function getPageHTML(
|
|||||||
const state = await store.toJS();
|
const state = await store.toJS();
|
||||||
const css = sheet.getStyleTags();
|
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());
|
const template = compile(readFileSync(templateFileName).toString());
|
||||||
return template({
|
return template({
|
||||||
redocHTML: `
|
redocHTML: `
|
||||||
|
|||||||
Reference in New Issue
Block a user