@@ -181,7 +181,7 @@ export class WikiConsole extends WikiRunner {
181181 runDisplayContent ( runCommand : RunCommand ) : RunResult {
182182 let text = this . checkForText ( runCommand ) ;
183183 let textAfter = this . checkForTextAfter ( runCommand ) ;
184- let title = this . checkForTitle ( runCommand ) ;
184+ let stepTitle = this . checkForTitle ( runCommand ) ;
185185 let tempFile = path . join ( this . getTempDirectory ( ) , runCommand . command . name + ".md" ) ;
186186 fs . writeFileSync ( tempFile , "" ) ;
187187 let counter = 2 ;
@@ -195,21 +195,19 @@ export class WikiConsole extends WikiRunner {
195195 this . createFolder ( path . join ( this . outputPathTutorial , "images" ) , false ) ;
196196 let imageName = path . join ( this . outputPathTutorial , "images" , path . basename ( param . image ) ) ;
197197 while ( fs . existsSync ( imageName ) ) {
198- imageName = path . join ( this . outputPathTutorial , "images" , counter + "_" + path . basename ( param . image ) ) ;
198+ imageName = path . join ( this . outputPathTutorial , "images" , path . parse ( param . image ) . name + "_" + counter + path . parse ( param . image ) . ext ) ;
199199 counter ++ ;
200200 }
201- fs . createFileSync ( imageName ) ;
202201 fs . copyFileSync ( path . join ( this . playbookPath , param . image ) , imageName ) ;
203202 fs . appendFileSync ( tempFile , "image::images/" + path . basename ( imageName ) + "[]" ) ;
204- counter = 2 ;
205203 }
206204 fs . appendFileSync ( tempFile , "\n\n" ) ;
207205 }
208206
209207 let content = fs . readFileSync ( tempFile , "utf-8" ) ;
210208
211- this . renderWiki ( path . join ( this . getRunnerDirectory ( ) , "templates" , "nextKatacodaStep .asciidoc" ) ,
212- { steptitle : runCommand . stepTitle , text : runCommand . text , textAfter : runCommand . textAfter , title : runCommand . command . parameters [ 0 ] , content : content , path : runCommand . command . parameters [ 2 ] } ) ;
209+ this . renderWiki ( path . join ( this . getRunnerDirectory ( ) , "templates" , "displayContent .asciidoc" ) ,
210+ { steptitle : stepTitle , text : text , textAfter : textAfter , title : runCommand . command . parameters [ 0 ] , content : content , path : runCommand . command . parameters [ 2 ] } ) ;
213211
214212 return null ;
215213 }
0 commit comments