File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11function generateBreadCrumb ( ) {
22 const breadCrumbContainer = document . getElementById ( "breadcrumb" ) ;
33
4- // Get path parts
4+ // Split the pathname into parts
55 let pathArray = window . location . pathname . split ( "/" ) . filter ( ( p ) => p ) ;
66
7+ // Detect repo name (first part of GitHub Pages URL)
78 const repoName = pathArray . length > 0 ? pathArray [ 0 ] : "" ;
89 const basePath = `/${ repoName } ` ;
910
10- // Drop the repo name so breadcrumb starts clean
11+ // Drop repo name from breadcrumb display
1112 if ( repoName ) {
1213 pathArray . shift ( ) ;
1314 }
@@ -17,7 +18,7 @@ function generateBreadCrumb() {
1718 pathArray . pop ( ) ;
1819 }
1920
20- // Start breadcrumb with home icon
21+ // Start breadcrumb with monitor icon (link to repo root)
2122 let breadcrumbHTML = `
2223 <a href="${ basePath } /index.html">
2324 <img src="${ basePath } /assets/Icons/monitor.png" style="width: 30px;"/>
You can’t perform that action at this time.
0 commit comments