Choosing 404.md over NotFound.vue #576
Labels
type: feature request
Request to add a new feature
version: next
Planned to do or already included in the next(1.0.0) version
Feature request
What problem does this feature solve?
After using vuepress a lot, I stumbled over two problems with the current handling of missing routes.
/404.md
file, the whole error pages is defined byNotFound.vue
, at the theme level. This couples the layout with the content and changes he behaviour compared to normal pages usingLayout.vue
, where<Content>
is available. Additional information like a list of site specific, helpful links or messages can therefore only be added overconfig.js
or similar places, reducing the ease of use, compared to markdown files./404.html
, vuepress immediately changes the page's content to the one inNotFound.vue
, hiding the previously content after a fleeting glimpse.I am also not sure if the latter one was intended, as
/404.md
pages are especially handled by vuepress (see the following code snippet from https://github.com/vuejs/vuepress/blob/master/lib/build.js).However, it is only rendered if
example.org/404.html
is directly accessed, but hidden if only its content is delivered for routes likeexample.org/missing.html
. Which is the fixed behaviour of AWS S3 and CloudFront, delivering only the content of an error page, without causing an additional redirect.What does the proposed API look like?
How should this be implemented in your opinion?
/404.md
accessible to the theme'sNotFound.vue
via<Content>
./404.html
based onNotFound.vue
and falling back toLayout.vue
if the former is missing.^/404.md
instead ofNotFound.vue
forpath: '*'
.^On a site note, this also makes it easier to generate error pages which retain the overall layout, including the header, navigation, ...
Are you willing to work on this yourself?**
Sure 👍
The text was updated successfully, but these errors were encountered: