Replies: 1 comment
-
maybe |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using the
#not-found
layout slot from the default theme to change the 404 page.However, I'd like to write some logic that would use the name of the missing page to change what's displayed in the not-found template (for example, a link to Gitlab for making a PR and add the missing page).
I'm not sure if there's a way, at present, to access this information in the way it's currently set up in Vitepress.
It seems the
page
property fromuseData()
doesn't contain much information when the page is not found.{ "relativePath": "", "filePath": "", "title": "404", "description": "Not Found", "headers": [], "frontmatter": { "sidebar": false, "layout": "page" }, "lastUpdated": 0, "isNotFound": true }
Is this a missing feature, or if there an alternative way to do this?
Trying to read the URL from
window.location.href
is a bit hacky, and it doesn't seem to work after building the site statically.Beta Was this translation helpful? Give feedback.
All reactions