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

Routing in Forge Docs #164

Closed
ijpatricio opened this issue Aug 23, 2023 · 1 comment
Closed

Routing in Forge Docs #164

ijpatricio opened this issue Aug 23, 2023 · 1 comment
Assignees

Comments

@ijpatricio
Copy link

ijpatricio commented Aug 23, 2023

Description

First, I'm sorry for opening the issue in this repo. The Docs repo doesn't have "Issues" enabled, so I figured this was the best suitable option.

The issue I found is: navigation is broken, from the nav-menu, when opening in a new tab.

From my hunch, this is a Vitepress build on a public folder /docs/** in the forge site, or something similar, right?
It works on the navigation because of client-side routing.
When the render comes from the server side, it doesn't find the route or the site.

From inspecting the response from https://forge.laravel.com/docs, I can see it serves as a redirect to https://forge.laravel.com/docs/introduction.html

I've done this in the past with SPA's: having one with client-side routing beneath a folder.

Route::get('/docs/{path?}', SpaController::class)->where('path', '.*');

This would serve the contents of the index view, and client side routing would do its thing.

Let me know if you would like me to find a solution with Vitepress underneath a folder.

Thanks for Laravel

Steps To Reproduce

Go from the docs root path: https://forge.laravel.com/docs and then navigate on the left nav-menu, all is good.
After navigating, you get the .html "extension" on the URL, which allows you to copy-paste the link.

But, on the navigation menu, if you "open in new tab" (cmd+click), it will not contain ".html", hence the URL won't work.

Try it: https://forge.laravel.com/docs/resources/scheduler

image

@jbrooksuk
Copy link
Member

Thanks for reporting this. I've deployed a change to the docs that will make the sidebar generate with the .html extension.

@jbrooksuk jbrooksuk self-assigned this Aug 23, 2023
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