Skip to content

Local non-md file links are still hashed by docsify #203

Description

@backspaces

TL;DR: How do I create links in my .md files that are not hashed by docsify?

Details: I have a link in my .md files that looks like: [hello world](/tutorial/?hello)

The /tutorial/index.html uses a query string to select the js file to run, here hello.js.

Clicking on the link gives a 404 error due to hashing the url:

GET http://localhost/src/asx/docs/tutorial/README.md 404 (Not Found)
http://localhost/src/asx/docs/#/tutorial/?hello=undefined

If I convert to [hello world](/tutorial/index.html?hello) I still get a hash conversion and an undefined error:

http://localhost/src/asx/docs/#/tutorial/index.html?hello=undefined
GET http://localhost/src/asx/docs/tutorial/_sidebar.md 404 (Not Found)

If I remove the hash to either of:

http://localhost/src/asx/docs/tutorial/?hello
http://localhost/src/asx/docs/tutorial/index.html?hello

and directly paste into the url bar, both work as expected.

If I use either of these complete urls in the .md file, it also works, but that fails to work on both my local system and github due to the differences in the url paths.

I also tried building an alias for /tutorials that uses document.location

'/tut': ${document.location.href.replace(/#.*/,'')}tutorial/,

.. which produces:

/tut: "http://localhost/src/asx/docs/tutorial/"

..thus solves the issue of github/localhost differences.

but using [hello world](/tut/?hello) fails, apparently the alias needs to be the entire path?

How do I create links in my .md files that are not hashed by docsify?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions