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

When replacing version number and using sub folders sub folder URI is removed #76

Closed
craigharman opened this issue Jan 16, 2019 · 2 comments

Comments

@craigharman
Copy link

Describe the bug
I have my docs in sub folders:

/resources/docs/v2/
index.md
/integrations/twitter.md
/integrations/facebook.md

This all works fine except that the routing no longer works if I don't include the version number.
eg. if i link to http://test.com/docs/integrations/twitter.md I get redirected to http://test.com/docs/twitter.md (the integrations path has been removed).
If I use the full URL with the version number it works: http://test.com/docs/2.0/twitter.md

To Reproduce
Create a folder structure as above and go to the domain minus the version number.

Expected behavior
I should be redirect to the latest version of the /integrations/twitter doc (in this case version 2) at http://test.com/docs/2.0/twitter.md

@adameffandi
Copy link

I've the similar situations when I've installed my system using xampp and calling it using subfolder, like:

[ip-number]/[system-folder]/docs

It's fine when calling the docs route (the default route) but when I click to redirect to other pages, it removes the [system-folder] url, leaving it like:

[ip-number]/docs/1.0/oraclehelper

and so the page can't be accessed because it should be like this:

[ip-number]/[system-folder]/docs/1.0/oraclehelper

Can someone assist? Thanks.

@saleem-hadad
Copy link
Owner

Hello @craigharman , thanks for sharing your issue
I tried to reproduce the error and it seems nothing is wronge with the behavior

I've created this structure:
/resources/docs/1.0/index.md
/resources/docs/1.0/integration/hello.md

When I hit this route: domain.com/docs/1.0/integration/hello it works, however, when I omit the version I got redirected to domain.com/docs/1.0/hello.md which is correct actually because the first param is assumed to be the version number and if the version not found (in this case it considered integration as a version) it will redirect you to the latest one (which in my case 1.0)

If you're trying to add a link to other pages just make sure you add {{version}} so that it will be converted to the correct one :) see an example from larecipe docs

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

3 participants