Skip to content

Commit d407bb4

Browse files
committed
Update page router to inject live edit scripts when enabled
1 parent 3e4e39c commit d407bb4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/realtime-compiler/src/Routing/PageRouter.php

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Desilva\Microserve\Request;
66
use Desilva\Microserve\Response;
77
use Hyde\Foundation\Facades\Routes;
8+
use Hyde\Pages\Concerns\BaseMarkdownPage;
89
use Hyde\Framework\Actions\StaticPageBuilder;
910
use Hyde\RealtimeCompiler\Http\LiveEditController;
1011
use Hyde\Framework\Features\Documentation\DocumentationSearchPage;
@@ -75,6 +76,10 @@ protected function getHtml(HydePage $page): string
7576
$contents = $page->compile();
7677
}
7778

79+
if ($page instanceof BaseMarkdownPage && LiveEditController::enabled()) {
80+
$contents = LiveEditController::injectLiveEditScript($contents);
81+
}
82+
7883
return $contents;
7984
}
8085

0 commit comments

Comments
 (0)