Skip to content

Commit ae3a075

Browse files
committed
fix css for orgs
1 parent f2a0744 commit ae3a075

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/lib/utils/FetchData.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,22 @@ export async function tryFetchFromAllCommonBranches(basePath: string, pageType:
3030
const cssFile = cssFileNames[pageType];
3131

3232
for (const branch of commonBranches) {
33-
const url = `${basePath}/${owner}/${repo || owner}/${branch}/${cssFile}`;
33+
let url: string;
34+
35+
if (pageType === GitHubPageType.Organization) {
36+
// For organizations, the path for the repo is always '.github'
37+
url = `${basePath}/${owner}/.github/${branch}/${cssFile}`;
38+
} else {
39+
// For other types, use the normal repo structure
40+
url = `${basePath}/${owner}/${repo || owner}/${branch}/${cssFile}`;
41+
}
42+
3443
try {
3544
const response = await fetch(url, { method: 'HEAD' });
3645
if (response.ok) {
3746
return url;
3847
} else if (response.status === 404) {
39-
console.log(`Could not find custom css for ${owner} on branch ${branch}`);
48+
console.log(`Could not find custom CSS for ${owner} on branch ${branch}`);
4049
}
4150
} catch (error) {
4251
console.log(`Failed to fetch CSS file at ${url}: ${error}`);

0 commit comments

Comments
 (0)