File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -483,16 +483,15 @@ <h3>🔌 API Endpoints</h3>
483483 class GitHubFollowerDashboard {
484484 constructor ( ) {
485485 this . data = { } ;
486- // Fix the base URL calculation for GitHub Pages
487- // Current URL: https://cpscript.github.io/Github-Profile-Monitor/dashboard/
488- // We want : https://cpscript.github.io/ Github-Profile-Monitor/
486+ // Use GitHub raw content URLs instead of GitHub Pages
487+ // Dashboard URL: https://cpscript.github.io/Github-Profile-Monitor/dashboard/
488+ // Raw content : https://raw.githubusercontent.com/CPScript/ Github-Profile-Monitor/main/data /
489489 const pathParts = window . location . pathname . split ( '/' ) . filter ( p => p ) ;
490- if ( pathParts . length > 1 && pathParts [ pathParts . length - 1 ] === 'dashboard' ) {
491- // Remove 'dashboard' from the end to get the repo base
492- this . baseUrl = window . location . origin + '/' + pathParts . slice ( 0 , - 1 ) . join ( '/' ) ;
493- } else if ( pathParts . length > 0 ) {
494- // For other GitHub Pages structures
495- this . baseUrl = window . location . origin + '/' + pathParts [ 0 ] ;
490+ if ( pathParts . length > 0 ) {
491+ // Extract username and repo from GitHub Pages URL
492+ const subdomain = window . location . hostname . split ( '.' ) [ 0 ] ; // cpscript
493+ const repoName = pathParts [ 0 ] ; // Github-Profile-Monitor
494+ this . baseUrl = `https://raw.githubusercontent.com/${ subdomain } /${ repoName } /main` ;
496495 } else {
497496 // Fallback for local development
498497 this . baseUrl = window . location . origin ;
You can’t perform that action at this time.
0 commit comments