Skip to content

Commit 18eca9c

Browse files
authored
Fix web site (#106)
* patch for site * Update kit and remove `trailingSlash: "always"` * Update .github/workflows/GHPages.yml
1 parent d14115a commit 18eca9c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ export function markdownPath(path) {
6969
// eslint-disable-next-line no-param-reassign -- ignore
7070
path = stripBaseUrl(path)
7171

72-
let normalized = path === "/" ? "README" : path.replace(/^\/|\/$/g, "")
72+
let normalized =
73+
!path.trim() || path === "/" ? "README" : path.replace(/^\/|\/$/g, "")
7374
return `${normalized}.md`
7475
}
7576

@@ -95,10 +96,9 @@ export const menuItems = readable([], function start(set) {
9596

9697
function generateMenu($page, toc) {
9798
const result = []
98-
const [, menus] =
99-
Object.entries(SIDE_MENU).find(([k]) =>
100-
stripBaseUrl($page.url.pathname).startsWith(k),
101-
) || SIDE_MENU["/"]
99+
const [, menus] = Object.entries(SIDE_MENU).find(([k]) =>
100+
stripBaseUrl($page.url.pathname).startsWith(k),
101+
) || ["/", SIDE_MENU["/"]]
102102
for (const { path, title, children } of menus) {
103103
const active = isActive(path, $page)
104104
if (active) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
"@ota-meshi/eslint-plugin": "^0.10.0",
7777
"@ota-meshi/eslint-plugin-svelte": "^0.26.0",
7878
"@sindresorhus/slugify": "^2.1.0",
79-
"@sveltejs/adapter-static": "^1.0.0-next.21",
80-
"@sveltejs/kit": "^1.0.0-next.201",
79+
"@sveltejs/adapter-static": "^1.0.0-next.26",
80+
"@sveltejs/kit": "^1.0.0-next.240",
8181
"@types/eslint": "^8.0.0",
8282
"@types/eslint-scope": "^3.7.0",
8383
"@types/eslint-visitor-keys": "^1.0.0",

svelte.config.esm.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const config = {
4040
assets: path.join(dirname, "./docs-svelte-kit/statics"),
4141
},
4242

43-
trailingSlash: "always",
43+
// trailingSlash: "always",
4444

4545
vite: {
4646
server: {

0 commit comments

Comments
 (0)