diff --git a/.gitignore b/.gitignore index 2a18d86d..18e2f638 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ .env .netlify /artifacts/_redirects +/artifacts/index.html /cars /dist diff --git a/tasks/deploy/ipfs.ts b/tasks/deploy/ipfs.ts index 16cb9d90..6b994d8f 100644 --- a/tasks/deploy/ipfs.ts +++ b/tasks/deploy/ipfs.ts @@ -63,6 +63,7 @@ const blockstore = new MemoryBlockstore(); const source = [ "artifacts/_redirects", "artifacts/artifacts.json", + "artifacts/index.html", "artifacts/versions.json", ].map( (path) => { diff --git a/tasks/generate-redirects.ts b/tasks/generate-redirects.ts index 6236f37f..dae56b68 100644 --- a/tasks/generate-redirects.ts +++ b/tasks/generate-redirects.ts @@ -229,3 +229,31 @@ rules.forEach((rule) => { }); Deno.writeTextFileSync("artifacts/_redirects", redirects); + +//////////////////////////////////////////// +// `index.html` fallback redirect +// +// Gateways that honour Netlify-style `_redirects` will serve the root +// rule above. This page is a fallback for gateways that don't: a +// client-side redirect to the latest release. +//////////////////////////////////////////// + +const version = latestRelease.version; + +const indexHtml = ` + + + + +Diffuse + + + + +Redirecting to the latest release of Diffuse. + + + +`; + +Deno.writeTextFileSync("artifacts/index.html", indexHtml);