fix: avoid docs demo redirect loop
This commit is contained in:
+11
-28
@@ -1,28 +1,11 @@
|
||||
# Cloudflare Pages rewrites for the static docs demo SPA.
|
||||
# Keep these scoped to app routes so runtime JS/CSS/assets are served directly.
|
||||
/demo /demo/index.html 200
|
||||
/demo/ /demo/index.html 200
|
||||
/demo/app /demo/index.html 200
|
||||
/demo/app/ /demo/index.html 200
|
||||
/demo/runtime /demo/runtime/app.html 200
|
||||
/demo/runtime/ /demo/runtime/app.html 200
|
||||
/demo/runtime/app /demo/runtime/app.html 200
|
||||
/demo/runtime/app/ /demo/runtime/app.html 200
|
||||
/demo/runtime/home /demo/runtime/app.html 200
|
||||
/demo/runtime/home/* /demo/runtime/app.html 200
|
||||
/demo/runtime/install /demo/runtime/app.html 200
|
||||
/demo/runtime/install/* /demo/runtime/app.html 200
|
||||
/demo/runtime/trial /demo/runtime/app.html 200
|
||||
/demo/runtime/trial/* /demo/runtime/app.html 200
|
||||
/demo/runtime/invite /demo/runtime/app.html 200
|
||||
/demo/runtime/invite/* /demo/runtime/app.html 200
|
||||
/demo/runtime/devices /demo/runtime/app.html 200
|
||||
/demo/runtime/devices/* /demo/runtime/app.html 200
|
||||
/demo/runtime/support /demo/runtime/app.html 200
|
||||
/demo/runtime/support/* /demo/runtime/app.html 200
|
||||
/demo/runtime/settings /demo/runtime/app.html 200
|
||||
/demo/runtime/settings/* /demo/runtime/app.html 200
|
||||
/demo/runtime/login /demo/runtime/app.html 200
|
||||
/demo/runtime/login/* /demo/runtime/app.html 200
|
||||
/demo/runtime/admin /demo/runtime/app.html 200
|
||||
/demo/runtime/admin/* /demo/runtime/app.html 200
|
||||
# Cloudflare Pages rewrites for non-materialized static docs demo runtime routes.
|
||||
# Use the directory entrypoint so Pages clean URLs do not loop between app.html and app.
|
||||
/demo/runtime/home/* /demo/runtime/app/ 200
|
||||
/demo/runtime/install/* /demo/runtime/app/ 200
|
||||
/demo/runtime/trial/* /demo/runtime/app/ 200
|
||||
/demo/runtime/invite/* /demo/runtime/app/ 200
|
||||
/demo/runtime/devices/* /demo/runtime/app/ 200
|
||||
/demo/runtime/support/* /demo/runtime/app/ 200
|
||||
/demo/runtime/settings/* /demo/runtime/app/ 200
|
||||
/demo/runtime/login/* /demo/runtime/app/ 200
|
||||
/demo/runtime/admin/* /demo/runtime/app/ 200
|
||||
|
||||
@@ -138,7 +138,7 @@ params.delete("path");
|
||||
params.delete("screen");
|
||||
params.delete("admin_section");
|
||||
params.set("path", initialRoute);
|
||||
frame.src = `${runtimeBase}/app.html?${params.toString()}${window.location.hash || ""}`;
|
||||
frame.src = `${runtimeBase}/app/?${params.toString()}${window.location.hash || ""}`;
|
||||
|
||||
const routeFromRuntimeUrl = (url) => {
|
||||
if (url.origin !== window.location.origin) return "";
|
||||
@@ -162,7 +162,7 @@ const runtimeSrc = (route, searchParams = new URLSearchParams()) => {
|
||||
nextParams.delete("screen");
|
||||
nextParams.delete("admin_section");
|
||||
nextParams.set("path", normalizePath(route));
|
||||
return `${runtimeBase}/app.html?${nextParams.toString()}${window.location.hash || ""}`;
|
||||
return `${runtimeBase}/app/?${nextParams.toString()}${window.location.hash || ""}`;
|
||||
};
|
||||
const topbar = document.querySelector(".demo-topbar");
|
||||
const toggle = document.querySelector(".demo-topbar__toggle");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
const defaultDemoSrc = '/demo/runtime/app.html?path=/home&mock=tariffs';
|
||||
const defaultDemoSrc = '/demo/runtime/app/?path=/home&mock=tariffs';
|
||||
const docsHref = '/getting-started/demo/';
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user