Add a "edit this page" button on the NotFound page #10986
Unanswered
Salamandar
asked this question in
Q&A
Replies: 1 comment 2 replies
-
The NotFound page is generic. You are not on a doc, so you can't call There is no way for Docusaurus to figure out which doc this "edit this page" button should link to. It can be any doc, or even a blog post. If you want to render such button on this page, you'd probably have to hardcode the URL you want to edit, or provide your own logic. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to add a link to the "edit url" of the page on the NotFound page. I swizzled it and am trying to call
useDoc()
to get the page metadata and theeditUrl
. But I getHook is called outside the <DocProvider>.
(yes with two spaces between Hook and is).It looks like the NotFound page is not linked to the doc plugin, so I can't call useDoc… Is there another way to get the editUrl?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions