Skip to content

Commit 7fe1f82

Browse files
authored
fix: correct github link (sveltejs#511)
closes sveltejs#106
1 parent 8f4be8f commit 7fe1f82

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

apps/svelte.dev/src/lib/components/PageControls.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
44
interface Props {
55
repo: string;
6-
path: string;
76
prev: null | {
87
path: string;
98
title: string;
@@ -14,11 +13,11 @@
1413
};
1514
}
1615
17-
let { repo, path, prev, next }: Props = $props();
16+
let { repo, prev, next }: Props = $props();
1817
</script>
1918

2019
<p class="edit">
21-
<a href="{repo}/edit/main/{path}">
20+
<a href={repo}>
2221
<Icon name="edit" /> Edit this page on GitHub
2322
</a>
2423
</p>

apps/svelte.dev/src/routes/docs/[...path]/+page.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
setupDocsHovers();
1212
1313
let content = $state() as HTMLElement;
14+
15+
const repo = $derived.by(() => {
16+
const name = data.document.slug.split('/')[1];
17+
const link = 'docs/' + data.document.file.split('/').slice(2).join('/');
18+
return `https://github.com/sveltejs/${name}/edit/main/documentation/${link}`;
19+
});
1420
</script>
1521

1622
<svelte:head>
@@ -40,8 +46,7 @@
4046
</div>
4147

4248
<PageControls
43-
repo="https://github.com/sveltejs/svelte.dev"
44-
path="apps/svelte.dev/content/{data.document.file}"
49+
{repo}
4550
prev={data.document.prev && {
4651
title: data.document.prev.title,
4752
path: `/${data.document.prev.slug}`

apps/svelte.dev/src/routes/tutorial/[...slug]/Sidebar.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@
6767
</div>
6868

6969
<PageControls
70-
repo="https://github.com/sveltejs/svelte.dev"
71-
path="apps/svelte.dev/content/{exercise.dir}"
70+
repo="https://github.com/sveltejs/svelte.dev/edit/main/apps/svelte.dev/content/{exercise.dir}"
7271
prev={exercise.prev && {
7372
title: exercise.prev.title,
7473
path: `/tutorial/${exercise.prev.slug}`

0 commit comments

Comments
 (0)