From 3d78563f000d1dc9e6c334c66e378ff2ba2e8896 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Mon, 24 Jan 2022 15:33:31 +0900 Subject: [PATCH 1/3] patch for site --- .github/workflows/GHPages.yml | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/GHPages.yml b/.github/workflows/GHPages.yml index 4a8fc0c99..8d9ae7117 100644 --- a/.github/workflows/GHPages.yml +++ b/.github/workflows/GHPages.yml @@ -3,7 +3,7 @@ name: GHPages on: workflow_dispatch: null push: - branches: [main] + branches: [main, site] jobs: deploy-docs: diff --git a/package.json b/package.json index 46c6c08b7..9dc13ec1c 100644 --- a/package.json +++ b/package.json @@ -76,8 +76,8 @@ "@ota-meshi/eslint-plugin": "^0.10.0", "@ota-meshi/eslint-plugin-svelte": "^0.26.0", "@sindresorhus/slugify": "^2.1.0", - "@sveltejs/adapter-static": "^1.0.0-next.21", - "@sveltejs/kit": "^1.0.0-next.201", + "@sveltejs/adapter-static": "^1.0.0-next.26", + "@sveltejs/kit": "1.0.0-next.229", "@types/eslint": "^8.0.0", "@types/eslint-scope": "^3.7.0", "@types/eslint-visitor-keys": "^1.0.0", From bc9bf5ddd12d31dcc750950fb2a0a7a3c0462231 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Mon, 24 Jan 2022 16:20:04 +0900 Subject: [PATCH 2/3] Update kit and remove `trailingSlash: "always"` --- docs-svelte-kit/src/lib/utils.js | 10 +++++----- package.json | 2 +- svelte.config.esm.mjs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs-svelte-kit/src/lib/utils.js b/docs-svelte-kit/src/lib/utils.js index 8eecc14e2..9c58a6db2 100644 --- a/docs-svelte-kit/src/lib/utils.js +++ b/docs-svelte-kit/src/lib/utils.js @@ -69,7 +69,8 @@ export function markdownPath(path) { // eslint-disable-next-line no-param-reassign -- ignore path = stripBaseUrl(path) - let normalized = path === "/" ? "README" : path.replace(/^\/|\/$/g, "") + let normalized = + !path.trim() || path === "/" ? "README" : path.replace(/^\/|\/$/g, "") return `${normalized}.md` } @@ -95,10 +96,9 @@ export const menuItems = readable([], function start(set) { function generateMenu($page, toc) { const result = [] - const [, menus] = - Object.entries(SIDE_MENU).find(([k]) => - stripBaseUrl($page.url.pathname).startsWith(k), - ) || SIDE_MENU["/"] + const [, menus] = Object.entries(SIDE_MENU).find(([k]) => + stripBaseUrl($page.url.pathname).startsWith(k), + ) || ["/", SIDE_MENU["/"]] for (const { path, title, children } of menus) { const active = isActive(path, $page) if (active) { diff --git a/package.json b/package.json index 9dc13ec1c..d79d8689f 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "@ota-meshi/eslint-plugin-svelte": "^0.26.0", "@sindresorhus/slugify": "^2.1.0", "@sveltejs/adapter-static": "^1.0.0-next.26", - "@sveltejs/kit": "1.0.0-next.229", + "@sveltejs/kit": "^1.0.0-next.240", "@types/eslint": "^8.0.0", "@types/eslint-scope": "^3.7.0", "@types/eslint-visitor-keys": "^1.0.0", diff --git a/svelte.config.esm.mjs b/svelte.config.esm.mjs index 577dae5f7..4cf11f65e 100644 --- a/svelte.config.esm.mjs +++ b/svelte.config.esm.mjs @@ -40,7 +40,7 @@ const config = { assets: path.join(dirname, "./docs-svelte-kit/statics"), }, - trailingSlash: "always", + // trailingSlash: "always", vite: { server: { From 86213d8724923ca8028335b57761a75088c4e68c Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Mon, 24 Jan 2022 16:25:32 +0900 Subject: [PATCH 3/3] Update .github/workflows/GHPages.yml --- .github/workflows/GHPages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/GHPages.yml b/.github/workflows/GHPages.yml index 8d9ae7117..4a8fc0c99 100644 --- a/.github/workflows/GHPages.yml +++ b/.github/workflows/GHPages.yml @@ -3,7 +3,7 @@ name: GHPages on: workflow_dispatch: null push: - branches: [main, site] + branches: [main] jobs: deploy-docs: