svelteness / kit-docs

Documentation integration for SvelteKit.
https://kitdocs.vercel.app
MIT License
457 stars 32 forks source link

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

Closed 2394425147 closed 1 year ago

2394425147 commented 1 year ago

Issue

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

image

Reproduction

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!

gdagosto commented 1 year ago

I'm facing 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,
});