Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

routeRewrite / redirect support like alias #1982

Closed
meghprkh opened this issue Jan 31, 2023 · 1 comment
Closed

routeRewrite / redirect support like alias #1982

meghprkh opened this issue Jan 31, 2023 · 1 comment

Comments

@meghprkh
Copy link

Feature request

redirect / routeRewrite like alias

What problem does this feature solve?

The problem is when docs are stored in a subdirectory in the repo and served from there. If we use relative urls with relativePath true in docsify then everything works well, but if we want to use absolute paths, then it becomes a problem. This is because rendered markdown in Github viewer or otherwise would assume say /docs/mydir/a.md to be the link and not /mydir/a.md

Adding a routeRewrite would solve this, and also solve the sidebar issue too. #1761 #1891

What does the proposed API look like?

window.$docsify = {
  routeRedirect: {
      '/.*/_sidebar.md': '/_sidebar.md',
      '/docs/.*/': '/$1',
   }
}

How should this be implemented in your opinion?

Any link that points to any of these routes shall be rewritten. Note we must also do this for image links too and not just docsify hash/history router redirects.

Are you willing to work on this yourself?

Yes, but I would need help :)

@jhildenbiddle
Copy link
Member

Bug acknowledged. Tracking with #1891.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants