docsify: URLs 404 when given a trailing slash /

Bug Report

Steps to reproduce

Go to any page path and add a trailing slash / to the end Example: /#/hello/

What is current behaviour

The page apth /#/hello/ will 404

What is the expected behaviour

That the page requested is shown and works the same as /#/hello

Other relevant information

No

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: Windows 10

  • Node.js version: 8.11.3

  • npm/yarn version: 5.6.0

  • Browser version: Chrome Version 79.0.3945.130

  • Docsify version: latest unpkg (4.10.2)

  • Docsify plugins: search

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 2
  • Comments: 15 (10 by maintainers)

Most upvoted comments

This is is annoying for sure. We need to handle trailing slashes properly.

Additionally, we have high-level things to improve in Docsify:

  • first of all, we should not have two totally separate renderers for client vs SSR (duplicated logic, error prone keeping changes in sync)
  • we should not have duplicate logic across our two routers (also error prone keeping changes in sync, leading to inconsistency)

I think we can default to README.md by matter of the existing conventions, and we can also fall back to index.md if README.md is not found. Thoughts? *#!/*JoePea

On Mon, Jun 8, 2020 at 11:42 AM Kosala Nuwan Perera < notifications@github.com> wrote:

In GitHub Pages, isn’t README.md is the index.html or default.html behavior? I mean it would make more sense to have a README.md as a convention.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/docsifyjs/docsify/issues/1018#issuecomment-640803482, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACIVTW5D6WZPWFIKE3S7ADRVUWIXANCNFSM4KTDGRKQ .

In GitHub Pages, isn’t README.md is the index.html or default.html behavior? I mean it would make more sense to have a README.md as a convention.

Whoa, I’m two years late to the party, but has this been resolved at all? It’d be terrific if example.org/hello/README was just the same as example.org/hello

I have not started work on this. Will give it a crack over the weekend. Help is welcome should anyone else find they have the time.