svelteness/kit-docs

Extra "+page" included in the URL with sidebar navigation

Closed this issue · 1 comments

Issue

In the latest version (^1.1.1), using the sidebar for navigation currently appends a +page to the destination URL

image

Reproduction

  • Perform npm init @svelteness/kit-docs ./ in an empty folder
  • pnpm install all the dependencies
  • Remove default: true, from svelte.config.js (throws an error before building for the first time, since .svelte-kit/ doesn't exist yet)
  • Run npm run dev -- --open
  • Click on Documentation in the navbar
  • Click on any page title in the sidebar
  • There should be a 404 error showing up in the documentation view

This also happened when I tried to manually set the project up. I thought there might be a config parameter I'm missing somewhere that excluded the .md files, but this might also just be an issue with route handling in the sidebar, since the docs/+page.js redirects to the proper page just fine.

Thanks!

I'm facing the same issue.

  • Tried to use the quick install, lib is adding +page at the end of every URL and pages are 404.

  • Tried running the demo, same issue.

  • Tried copying the app that's running on the website, extracted it from this repo, still the same issue.

I've managed to write a small sidebar handler to fix it, but then the sidebar doesn't show the selected current page, and the previous and next buttons also don't work.

import { createSidebarRequestHandler } from "@svelteness/kit-docs/node";

export const GET = createSidebarRequestHandler({
  resolveSlug: (data) => "/" + data.cleanDirname,
});