File tree Expand file tree Collapse file tree 2 files changed +19
-24
lines changed Expand file tree Collapse file tree 2 files changed +19
-24
lines changed Original file line number Diff line number Diff line change 1616
1717 onMount (async () => {
1818 // only for genuine 500s on a top-level slug
19- if ($page .status === 500 ) {
20- const parts = $page .url .pathname .split (' /' ).filter (Boolean );
21- const repo = parts [0 ];
22-
23- if (repo ) {
24- fetchRepoDetails (config .githubUser , $page .params .repo , fetch )
25- .then ((res ) => {
26- if (res && res ?.id ) {
27- data .repoDetails = res as Project ;
28- data .meta = findRepoMeta (repo , config .projects ) || {};
29- console .log (data .repoDetails )
30- if (data .repoDetails .has_pages ) {
31- gitHubPagesUrl = ` https://${config .githubUser }.github.io/${repo }/ ` ;
32- }
19+
20+ const parts = $page .url .pathname .split (' /' ).filter (Boolean );
21+ const repo = parts [0 ];
22+ if (repo ) {
23+ fetchRepoDetails (config .githubUser , repo , fetch )
24+ .then ((res ) => {
25+ if (res && res ?.id ) {
26+ data .repoDetails = res as Project ;
27+ data .meta = findRepoMeta (repo , config .projects ) || {};
28+ console .log (data .repoDetails )
29+ if (data .repoDetails .has_pages ) {
30+ gitHubPagesUrl = ` https://${config .githubUser }.github.io/${repo }/ ` ;
3331 }
34- })
35- . catch (( err ) => {
36- console . error ( ' Error fetching repo details ' , err );
37- } );
38- }
32+ }
33+ })
34+ . catch (( err ) => {
35+ console . error ( ' Error fetching repo details ' , err );
36+ });
3937 }
38+
4039 });
4140 </script >
4241
Original file line number Diff line number Diff line change @@ -23,12 +23,8 @@ async function getGithubSlugs() {
2323
2424const githubSlugs = await getGithubSlugs ( ) ;
2525
26- console . log ( githubSlugs )
27-
28-
2926if ( isStatic && githubSlugs . length === 0 ) {
30- console . log ( 'ffs' )
31- // throw new Error('⚠️ No GitHub slugs found. Ensure GITHUB_TOKEN is set and has access to public repos.');
27+ throw new Error ( '⚠️ No GitHub slugs found. Ensure GITHUB_TOKEN is set and has access to public repos.' ) ;
3228}
3329
3430/** @type {import('@sveltejs/kit').Config } */
You can’t perform that action at this time.
0 commit comments