Closed Timeless0911 closed 1 week ago
We should generate 404.html by default in build process to let pageType: 404 and NotFoundLayout work in production by default.
404.html
pageType: 404
NotFoundLayout
Now we return 404 when generate site data, so we can visit 404 page in dev correctly
https://github.com/web-infra-dev/rspress/blob/150f770aaa3a02407af3ac3e25f0df36ddc4ac59/packages/core/src/runtime/App.tsx#L102-L117
but in production now we need to write a 404.mdx like below:
404.mdx
--- pageType: 404 --- import { NotFoundLayout } from "@theme" <NotFoundLayout />
. ├── index.html ├── 404.html └── static ├── css ├── js └── search_index.xxxxxx.json
What problem does this feature solve?
We should generate
404.html
by default in build process to letpageType: 404
andNotFoundLayout
work in production by default.Now we return 404 when generate site data, so we can visit 404 page in dev correctly
https://github.com/web-infra-dev/rspress/blob/150f770aaa3a02407af3ac3e25f0df36ddc4ac59/packages/core/src/runtime/App.tsx#L102-L117
but in production now we need to write a
404.mdx
like below:What does the proposed API look like?