File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,16 @@ export function Index({ asyncapi, params = {} }) {
99 const favicon = generateBase64Favicon ( params ) ;
1010 const renderedSpec = renderSpec ( asyncapi , params ) ;
1111 let asyncapiScript = `<script src="js/asyncapi-ui.min.js" type="application/javascript"></script>` ;
12- if ( params ?. singleFile ) {
12+ // coerce singleFile param to bool, or "false" string will be true
13+ const singleFile = ( params ?. singleFile === true || params ?. singleFile == 'true' ) ;
14+ if ( singleFile ) {
1315 asyncapiScript = `<script type="text/javascript">
1416 ${ includeFile ( 'template/js/asyncapi-ui.min.js' ) }
1517 </script>` ;
1618 }
1719 let styling = `<link href="css/global.min.css" rel="stylesheet">
1820 <link href="css/asyncapi.min.css" rel="stylesheet">` ;
19- if ( params ?. singleFile ) {
21+ if ( singleFile ) {
2022 styling = `<style type="text/css">
2123 ${ includeFile ( "template/css/global.min.css" ) }
2224 ${ includeFile ( "template/css/asyncapi.min.css" ) }
@@ -27,7 +29,7 @@ export function Index({ asyncapi, params = {} }) {
2729 basehref = `<base href="${ params . baseHref } ">` ;
2830 }
2931 let appJs = `<script type="application/javascript" src="js/app.js"></script>` ;
30- if ( params ?. singleFile ) {
32+ if ( singleFile ) {
3133 appJs = `<script>${ App ( { asyncapi, params} ) } </script>` ;
3234 }
3335 return ( `<!DOCTYPE html>
You can’t perform that action at this time.
0 commit comments