File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/resources/formats/html Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -168,9 +168,17 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
168168 return response . json ( ) . then ( function ( listingPaths ) {
169169 const listingHrefs = [ ] ;
170170 for ( const listingPath of listingPaths ) {
171+ const pathWithoutLeadingSlash = listingPath . listing . substring ( 1 ) ;
171172 for ( const item of listingPath . items ) {
172173 if ( item === thisPath || item === thisPath + "index.html" ) {
173- listingHrefs . push ( listingPath . listing ) ;
174+ // Resolve this path against the offset to be sure
175+ // we already are using the correct path to the listing
176+ // (this adjusts the listing urls to be rooted against
177+ // whatever root the page is actually running against)
178+ const relative = offsetRelativeUrl ( pathWithoutLeadingSlash ) ;
179+ const baseUrl = window . location ;
180+ const resolvedPath = new URL ( relative , baseUrl ) ;
181+ listingHrefs . push ( resolvedPath . pathname ) ;
174182 break ;
175183 }
176184 }
You can’t perform that action at this time.
0 commit comments