fix: redirect docs in new page, handle 404 vercel url

This commit is contained in:
Rotimi Best
2024-02-02 08:25:15 +01:00
parent f828b170b9
commit 7ee12e90e4
2 changed files with 7 additions and 2 deletions
@@ -127,7 +127,7 @@
<li class="text-gray-800 font-semibold text-sm cursor-pointer">Pricing</li>
</a>
<!-- Docs -->
<a href="/docs">
<a href="/docs" target="_blank">
<li class="text-gray-800 font-semibold text-sm cursor-pointer">Docs</li>
</a>
<!-- Blog -->
@@ -207,7 +207,7 @@
<li
class="text-gray-800 font-semibold text-sm md:text-lg cursor-pointer hover:bg-gray-100 py-3 px-4 rounded-md w-full"
>
<a on:click={handleShowNav} href="/docs"> Docs </a>
<a on:click={handleShowNav} href="/docs" target="_blank"> Docs </a>
</li>
<!-- Blog -->
@@ -31,6 +31,11 @@ export const load = async ({ url, cookies }): Promise<LoadOutput> => {
const matches = url.host.match(/([a-z 0-9 -]+).*classroomio[.]com/);
const subdomain = matches?.[1] ?? '';
if (!url.host.includes('.classroomio.com')) {
// TODO: We can verify if custom domain here
return response;
}
if (!blockedSubdomain.includes(subdomain)) {
const answer = Array.isArray(matches) ? !!subdomain && subdomain !== 'www' : false;