File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -71,10 +71,12 @@ function generateContents() {
7171 el = $ ( el ) ;
7272 const title = el . text ( ) ;
7373 const html = el . nextUntil ( 'h3' ) . html ( ) ;
74+ const id = el . prop ( 'id' ) ;
75+ const baseUrl = filename . replace ( '.md' , '.html' ) . replace ( / ^ d o c s / , '' ) ;
7476 const content = new Content ( {
7577 title : `${ file . title } : ${ title } ` ,
7678 body : html ,
77- url : `${ filename . replace ( '.md' , '.html' ) . replace ( / ^ d o c s / , '' ) } #${ el . prop ( 'id' ) } `
79+ url : id ? `${ baseUrl } #${ id } ` : baseUrl
7880 } ) ;
7981
8082 content . validateSync ( ) ;
@@ -102,10 +104,12 @@ function generateContents() {
102104 el = $ ( el ) ;
103105 const title = el . text ( ) ;
104106 const html = el . nextUntil ( 'h3' ) . html ( ) ;
107+ const id = el . prop ( 'id' ) ;
108+ const baseUrl = filename . replace ( '.pug' , '.html' ) . replace ( / ^ d o c s / , '' ) ;
105109 const content = new Content ( {
106110 title : `${ file . title } : ${ title } ` ,
107111 body : html ,
108- url : `${ filename . replace ( '.pug' , '.html' ) . replace ( / ^ d o c s / , '' ) } #${ el . prop ( 'id' ) } `
112+ url : id ? `${ baseUrl } #${ id } ` : baseUrl
109113 } ) ;
110114
111115 content . validateSync ( ) ;
You can’t perform that action at this time.
0 commit comments