Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.

Commit e1e809a

Browse files
committed
fix: update breadcrumb links and tag links to point to correct locations
1 parent aa4d8d7 commit e1e809a

File tree

3 files changed

+15
-30
lines changed

3 files changed

+15
-30
lines changed

src/lib/components/cards/RepositoryCard.svelte

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
99
// Fixed helper function to get repository URL path with proper handling of 'library' and nested repos
1010
function getRepoPath(repoName: string): string {
11-
// Handle 'library' special case
12-
if (repoName === 'library') {
13-
return '';
14-
}
15-
1611
// For nested repos like 'ofkm/caddy', we need to handle them correctly
1712
// The repository name itself should be included in the path
1813
return `${repoName}/`;
@@ -27,19 +22,8 @@
2722
return fullName;
2823
}
2924
30-
// Helper to construct correct detail URLs
31-
function getDetailUrl(repoName: string, imageName: string, tagName: string): string {
32-
if (repoName === 'library') {
33-
return `/details/${imageName}/${tagName}`;
34-
}
35-
return `/details/${repoName}/${imageName}/${tagName}`;
36-
}
37-
3825
// Helper to construct correct image URLs
3926
function getImageUrl(repoName: string, imageName: string): string {
40-
if (repoName === 'library') {
41-
return `/details/${imageName}`;
42-
}
4327
return `/details/${repoName}/${imageName}`;
4428
}
4529

src/routes/details/[repo]/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<Slash class="h-4 w-4" />
5454
</Breadcrumb.Separator>
5555
<Breadcrumb.Item>
56-
<Breadcrumb.Link class="text-foreground font-medium">
56+
<Breadcrumb.Link href="/details/{repoName}" class="text-foreground font-medium">
5757
{repoName}
5858
</Breadcrumb.Link>
5959
</Breadcrumb.Item>

src/routes/details/[repo]/[image]/[tag]/+page.svelte

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
});
7777
}
7878
}
79+
80+
const imageName = data.imageFullName.includes('/') ? data.imageFullName.split('/').pop() : data.imageFullName;
7981
</script>
8082

8183
<svelte:head>
@@ -116,26 +118,25 @@
116118
<Breadcrumb.Separator>
117119
<Slash class="h-4 w-4" />
118120
</Breadcrumb.Separator>
119-
{#if data.repo !== 'library'}
120-
<Breadcrumb.Item>
121-
<Breadcrumb.Link href="/" class="text-muted-foreground hover:text-foreground transition-colors">
122-
{data.repo}
123-
</Breadcrumb.Link>
124-
</Breadcrumb.Item>
125-
<Breadcrumb.Separator>
126-
<Slash class="h-4 w-4" />
127-
</Breadcrumb.Separator>
128-
{/if}
129121
<Breadcrumb.Item>
130-
<Breadcrumb.Link href="/" class="text-muted-foreground hover:text-foreground transition-colors">
131-
{data.imageFullName.includes('/') ? data.imageFullName.split('/').pop() : data.imageFullName}
122+
<Breadcrumb.Link href="/details/{data.repo}" class="text-muted-foreground hover:text-foreground transition-colors">
123+
{data.repo}
124+
</Breadcrumb.Link>
125+
</Breadcrumb.Item>
126+
<Breadcrumb.Separator>
127+
<Slash class="h-4 w-4" />
128+
</Breadcrumb.Separator>
129+
<Breadcrumb.Item>
130+
<Breadcrumb.Link href="/details/{data.repo}" class="text-muted-foreground hover:text-foreground transition-colors">
131+
<!-- {data.imageFullName.includes('/') ? data.imageFullName.split('/').pop() : data.imageFullName} -->
132+
{imageName}
132133
</Breadcrumb.Link>
133134
</Breadcrumb.Item>
134135
<Breadcrumb.Separator>
135136
<Slash class="h-4 w-4" />
136137
</Breadcrumb.Separator>
137138
<Breadcrumb.Item>
138-
<Breadcrumb.Link class="text-foreground font-medium">
139+
<Breadcrumb.Link href="/details/{data.repo}/{imageName}/{currentTag.name}" class="text-foreground font-medium">
139140
{currentTag.name}
140141
</Breadcrumb.Link>
141142
</Breadcrumb.Item>

0 commit comments

Comments
 (0)