Skip to content

routeRewrite / redirect support like alias #1982

Description

@meghprkh

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 :)

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions