File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/realtime-compiler/src/Routing Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1010use Hyde \Pages \Concerns \BaseMarkdownPage ;
1111use Hyde \Framework \Actions \StaticPageBuilder ;
1212use Hyde \RealtimeCompiler \Http \LiveEditController ;
13+ use Hyde \Framework \Exceptions \RouteNotFoundException ;
1314use Hyde \Framework \Features \Documentation \DocumentationSearchPage ;
1415use Hyde \Pages \Concerns \HydePage ;
1516use Hyde \RealtimeCompiler \Concerns \InteractsWithLaravel ;
@@ -98,6 +99,16 @@ protected function getPageFromRoute(): HydePage
9899 return new DocumentationSearchPage ();
99100 }
100101
101- return Routes::getOrFail ($ this ->normalizePath ($ this ->request ->path ))->getPage ();
102+ try {
103+ return Routes::getOrFail ($ this ->normalizePath ($ this ->request ->path ))->getPage ();
104+ } catch (RouteNotFoundException $ exception ) {
105+ $ index = Routes::get ($ this ->normalizePath ($ this ->request ->path ).'/index ' );
106+
107+ if ($ index ) {
108+ return $ index ->getPage ();
109+ }
110+
111+ throw $ exception ;
112+ }
102113 }
103114}
You can’t perform that action at this time.
0 commit comments