diff --git a/404/index.page.tsx b/404.tsx similarity index 81% rename from 404/index.page.tsx rename to 404.tsx index d3800f19..01c55f2d 100644 --- a/404/index.page.tsx +++ b/404.tsx @@ -1,6 +1,6 @@ export const layout = "raw.tsx"; -export const url = "/404"; -import { sidebar } from "../runtime/_data.ts"; +export const url = "/404.html"; +import { sidebar } from "./runtime/_data.ts"; const styles = /*css*/ ` #content nav { @@ -42,13 +42,7 @@ export default function Page(props: Lume.Data, helpers: Lume.Helpers) {

Sorry, couldn’t find that page.

-

- Failed to match route{" "} - - 404 - -

-

+

Maybe one of these links has what you're looking for?

diff --git a/_config.ts b/_config.ts index 123c23da..6ae98cb6 100644 --- a/_config.ts +++ b/_config.ts @@ -144,9 +144,9 @@ site.process([".html"], (pages) => { const document = page.document!; if (!document.querySelector(".ddoc")) { document.body.classList.add("apply-prism"); - document.querySelectorAll("body.apply-prism pre code").forEach(( - element, - ) => Prism.highlightElement(element)); + document + .querySelectorAll("body.apply-prism pre code") + .forEach((element) => Prism.highlightElement(element)); } } }); diff --git a/deno.lock b/deno.lock index d20af93d..c109abdc 100644 --- a/deno.lock +++ b/deno.lock @@ -1889,8 +1889,10 @@ "https://deno.land/x/esbuild@v0.24.0/mod.js": "15b51f08198c373555700a695b6c6630a86f2c254938e81be7711eb6d4edc74e", "https://deno.land/x/lume@v2.4.1/cli.ts": "dcdc9d6abc1a219f1b972772ba27be33cebeffebb3db2d82a3f3d752d789a758", "https://deno.land/x/lume@v2.4.1/cli/build.ts": "a3acda3c702d6a51a8fe65ea3abc17813deea0db71e442de6120a747f56a2466", + "https://deno.land/x/lume@v2.4.1/cli/build_worker.ts": "0a829ac3baadabc1c77103e0110429b67a4dc2a781898d21272087d34dc7be74", "https://deno.land/x/lume@v2.4.1/cli/cms.ts": "7f3f46c3353661a7679926d0ddcfe3e596f3c97ad2de7f535bde5906e42c3f5a", "https://deno.land/x/lume@v2.4.1/cli/create.ts": "f340056e3b01a61007f82b47a174ede55df2d80d343e492a3853d44007bb8fc6", + "https://deno.land/x/lume@v2.4.1/cli/missing_worker_apis.ts": "70625ded7fee5de7d215e0829ce8dc4bb7060f6a496c09db880ebaec8b3efb92", "https://deno.land/x/lume@v2.4.1/cli/run.ts": "27e7c84c2bcadc3aa4ca4fbad02330f33000dca9a2ef41780bad3676606bc029", "https://deno.land/x/lume@v2.4.1/cli/upgrade.ts": "a11e7c9024f78c2e7376c57b4a99e389dbf490769779d2d37a4a3ccd6ef27d9e", "https://deno.land/x/lume@v2.4.1/cli/utils.ts": "4697e4280ff62b537507ed707ec84ea707b0519f8de32e2e762f498104a8d1ae", @@ -1929,6 +1931,7 @@ "https://deno.land/x/lume@v2.4.1/core/utils/lume_config.ts": "1dd321aea867cbd5e744c6a81f82cd6caf4095ba93cabd03c667368be19494ba", "https://deno.land/x/lume@v2.4.1/core/utils/lume_version.ts": "96ce8c0144b5adbc170f388b60be706244d1bd100413e748e9cf23878838c87c", "https://deno.land/x/lume@v2.4.1/core/utils/merge_data.ts": "a574d97eeaa1513d30440488f52e988f0fe2085397611852673cea10076f01ff", + "https://deno.land/x/lume@v2.4.1/core/utils/net.ts": "7827473a96b28950ab8083582a1f810e56ab265c28196494d9d714f1e0c17e8a", "https://deno.land/x/lume@v2.4.1/core/utils/object.ts": "e00ee6e91264064772c87e69e128a09ba0e30c2c41be4a5302881f59f456fc31", "https://deno.land/x/lume@v2.4.1/core/utils/page_content.ts": "e7d4323a7b66d1ae26c1263dd5a13a0c5e9f73583c9cf83454ad61f157d8351d", "https://deno.land/x/lume@v2.4.1/core/utils/page_date.ts": "2a3d9c203df298ca61f568fdf509945f127f990769623c3edfd753d39807b757", @@ -1962,7 +1965,12 @@ "https://deno.land/x/lume@v2.4.1/deps/vento.ts": "50bb794a4aa7a65c0394d585277bfe85f2c44fd19a0d848dfa54cba52cf55b62", "https://deno.land/x/lume@v2.4.1/deps/xml.ts": "ca44c214383270649e96947571f997e8d8a0b120a2e038f2f3684783256b3921", "https://deno.land/x/lume@v2.4.1/deps/yaml.ts": "cbcf4d295ed88066e12a718750f09cebbf30fefa32e186844b597bce74b35557", + "https://deno.land/x/lume@v2.4.1/middlewares/logger.ts": "c96f1a9f9d5757555b6f141865ce8551ac176f90c8ee3e9ad797b2b400a9a567", + "https://deno.land/x/lume@v2.4.1/middlewares/no_cache.ts": "0119e3ae3a596ab12c42df693b93e5b03dd9608e289d862242751a9739438f35", + "https://deno.land/x/lume@v2.4.1/middlewares/no_cors.ts": "4d24619b5373c98bcc3baf404db47ba088c87ac8538ea1784e58d197b81d4d02", "https://deno.land/x/lume@v2.4.1/middlewares/not_found.ts": "4507842d422267062c34662dceab17affcaad01858a5890fda163a8ddeb31487", + "https://deno.land/x/lume@v2.4.1/middlewares/reload.ts": "ec723e917bd12c83f65fc39a66592add9ec2ab56a1ad17f429ba749d32c218f9", + "https://deno.land/x/lume@v2.4.1/middlewares/reload_client.js": "992ac4a2f4a9fb4a1ab5f23f674ef202a43d73652cdebcf7b1552b482a7410ef", "https://deno.land/x/lume@v2.4.1/mod.ts": "f93dcbc0ccb7a9e6cab93d0e8f1f0643b112f3084bedc603379dc1b47d7d380d", "https://deno.land/x/lume@v2.4.1/plugins/check_urls.ts": "316851b70200446a573b4269ae2793d414fc8f8083800b3197f543376ed81784", "https://deno.land/x/lume@v2.4.1/plugins/esbuild.ts": "2970f854f678eaa43ebc20a15e751fc8b9bc891b82f24b56553fc773cafaa29a", @@ -2158,7 +2166,6 @@ "jsr:@std/media-types@^1.0.3", "jsr:@std/path@^1.0.8", "npm:googleapis@144", - "npm:preact@*", "npm:tailwindcss@^3.4.9" ] } diff --git a/middleware/redirects.ts b/middleware/redirects.ts index b0f857ad..1f582dd0 100644 --- a/middleware/redirects.ts +++ b/middleware/redirects.ts @@ -46,15 +46,6 @@ export default async function redirectsMiddleware( res = await next(req); } - if (res.status === 404) { - res = new Response(null, { - headers: { - location: "/404" + "?path=" + encodeURIComponent(url.pathname) - }, - status: 303, - }); - } - return res; } catch (e) { res = new Response("Internal Server Error", {