Skip to content

Commit aa960c4

Browse files
committed
fix site
1 parent 29698fa commit aa960c4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs-svelte-kit/src/lib/footer/Footer.svelte

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
export let frontmatter = {}
77
88
let prev, next
9-
$: normalizedPath = normalizePath($page.path)
9+
$: markdownPath = normalizePath($page.path).replace(/^\/|\/$/g, "")
1010
$: {
1111
let prevItem, currItem
1212
for (const item of iterateMenuItem($menuItems)) {
@@ -42,11 +42,7 @@
4242
<div class="footer-tools">
4343
<div class="edit-link">
4444
<a
45-
href="https://github.com/ota-meshi/eslint-plugin-svelte/edit/main/docs/{normalizedPath.startsWith(
46-
'/',
47-
)
48-
? normalizedPath.slice(1)
49-
: normalizedPath}.md"
45+
href="https://github.com/ota-meshi/eslint-plugin-svelte/edit/main/docs/{markdownPath}.md"
5046
target="_blank"
5147
rel="noopener noreferrer">Edit this page</a
5248
>

docs-svelte-kit/src/lib/utils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ export function isActive(path, $page) {
5757
}
5858

5959
export function normalizePath(path) {
60-
return path === "/" ? "/README" : path
60+
let normalized = path === "/" ? "/README/" : path
61+
if (!normalized.endsWith("/")) {
62+
normalized += "/"
63+
}
64+
return normalized
6165
}
6266

6367
export const tocStore = writable([])

0 commit comments

Comments
 (0)