File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,10 +50,6 @@ class DocsPlugin {
5050 const bar = progress . defaultBar ( ) ;
5151 bar . start ( this . docs . length , 0 , { prefix : 'rendering images' , suffix : '-' } ) ;
5252 for ( const doc of this . docs ) {
53- console . log ( "doc" , doc ) ;
54- if ( doc . metadata . permalink === "/" ) {
55- doc . metadata . permalink = "/index" ;
56- }
5753 const document = new document_1 . Document ( this . getHtmlPath ( doc ) ) ;
5854 bar . update ( { suffix : doc . metadata . permalink } ) ;
5955 await document . load ( ) ;
@@ -76,7 +72,7 @@ class DocsPlugin {
7672 logger_1 . default . success ( 'Generated og images for docs pages' ) ;
7773 } ;
7874 getHtmlPath = ( doc ) => doc . metadata ?. permalink &&
79- path . join ( this . stripLangFromPath ( this . context . outDir ) , `${ doc . metadata . permalink } .html` ) ;
75+ path . join ( this . stripLangFromPath ( this . context . outDir ) , `${ doc . metadata . permalink } ${ doc . metadata . permalink . endsWith ( "/" ) ? "index" : "" } .html` ) ;
8076 stripLangFromPath = ( path ) => {
8177 const lang = this . context . i18n . locales . find ( ( locale ) => path . endsWith ( `/${ locale } ` ) ) ;
8278 return lang ? path . slice ( 0 , - lang . length - 1 ) : path ;
You can’t perform that action at this time.
0 commit comments