-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom 404 page #227
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Sorry I just realized that a custom 404 page was previously mentioned by @chrisjsewell #221! The Sphinx Not Found Page extension wouldn't be necessary if a custom 404 page was integrated in a different way |
Oh yeh was going to mention. |
I'm the author of the I don't see specific needs in #221 that won't allow people using sphinx-book-theme to use the extension. In fact, in the description of the issue, the linked project using a custom 404 page is using the sphinx-notfound-page 😄 If there is anything needed to be added to the extension to make it compatible with the sphinx-book-theme, I'd be happy to incorporate it. |
thanks @humitos! |
Hey! I just wanted to share that I was finally able to get the sphinx-notfound-extension working and create a custom 404 page in my Jupyter Book. I needed to add a "url prefix" to my own repository, which I did in the _config.yml file here. You can see an example of the custom 404 page here. Thanks for the great extension, @humitos! |
ah that's very cool! Thanks for sharing your solution! |
@melaniewalsh - any interest in making a quick post to the jupyter book discussions board that shows off this pattern? Maybe others would find it useful! Then I think that we could consider this issue closed? |
Thanks @melaniewalsh for sharing the solution!
Hehe, I was about to suggest adding an entry in the FAQ of the sphinx-notfound-page project at https://sphinx-notfound-page.readthedocs.io/en/latest/faq.html Either work to me. So, happy to have it documented somewhere. |
@choldgraf Sure, I'd be happy to write a quick post for the Jupyter Book discussion board! Also @humitos I could add an entry to the sphinx-notfound-page FAQ, too. But yes I think this issue is closed 🎉 |
amazing! thanks for being so helpful @melaniewalsh :-) |
Describe the bug
I know that Jupyter Book will not work predictably with custom Sphinx extensions, but I've been trying to integrate this Sphinx Not Found Page extension into my Jupyter Book so that I can have a custom 404 page. And I think this could be potentially useful for all Jupyter Book users.
Anyway, when I use this extension, I get the following error:
@humitos has been helping me debug this issue and usefully identified that there seems to be a problem in
sphinx-book-theme
in the functionfind_url_relative_to_root
, which is called fromgenerate_nav_html
.So I was wondering if there were any suggestions about how to make the Sphinx Not Found extension work with the Sphinx Book Theme. Thanks!
To Reproduce
_config.yml
Expected behavior
Custom 404 page is built that preserves CSS and JavaScript from Sphinx Book Theme
Environment
jupyter-book --version
:Jupyter Book: 0.8.2
MyST-NB: 0.10.1
Sphinx Book Theme: 0.0.36
MyST-Parser: 0.12.10
Jupyter-Cache: 0.4.1
NbClient: 0.4.0
The text was updated successfully, but these errors were encountered: