-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Contextualize 404 page #9657
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
Contextualize 404 page #9657
Conversation
…testing, and search for isn't safe to assume
…tandard Sphinx projects.
…e relevant 404 context
Note on the current state of the PR: I'm still not looking for a code review :) But a general comment on the approach of contextualizing the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love where are we going with this. 404 pages will be way better with these changes 💯
Co-authored-by: Manuel Kaufmann <[email protected]>
….org into contextualize-404
Going over the tests now, hadn't realized they were failing, was only testing on a small subset locally. |
Nice - the Django test client seems to have an option |
@stsewd ready for review - I added a POC of using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much simpler implementation 👍
Left some general suggestions
Co-authored-by: Santos Gallegos <[email protected]>
Thanks for the great and detailed review @stsewd 💯 Will do some manual testing and get back ⏳ |
@stsewd changes work locally, the failure in "checks" is unrelated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some information that will (should) always be available to templates, other than that I'm fine moving forward with this.
Co-authored-by: Santos Gallegos <[email protected]>
Co-authored-by: Santos Gallegos <[email protected]>
….org into contextualize-404
Super happy to move forwards on this, thanks for all the feedback @stsewd 👍 I hope that anyone encountering a 404 in the future will quickly pitch in with improvements to texts and suggestions. The new contents haven't been worked much with in the PR (although we did add some significant helpful texts and functions, as mentioned in the PR description). But it's great that we have now introduced a pattern that enables better 404 error handling with the option of using a targeted context, rather than unhelpfully broad messages. |
Update: This PR has gone through manual testing and is now ready for review.
Work history:
main
againTODO
instanceof
or similar{% url "elastic_project_search" project.slug %}
affords us this option across Documentation project types?errors/404/include_search.html
in cases where searching isn't possiblerequest.path
, not the one with_proxito_404_
in the path...What it looks like / scope
There are individual templates for different scenarios:
Subproject not foundScoped out, not currently covered by new unresolverEach case is detected, but we resort to only giving very basic suggestions and information. I made that choice to avoid discussing details at this stage.
Here is the 404 for a missing page:
And here is the 404 for a missing version:
Where to go now?
We can do more work to help users and documentation owners troubleshoot 404s. I think we just need to make small improvised changes to the 404s, as we get inspired from real life.
Brainstorming ideas for contextualized messages
Suggestions for "project page not found"
/latest/
branch and tell the user that projects are updated over time, so a link to "latest" may change and that's a good thing. They can look for the page in older versions if the latest version doesn't contain a similar page.Give people a search form for the project? That should be easy, right?This needs a lot more context, i.e. "Is this a Sphinx project?" and "Which language are we looking at?". I don't find it feasible to implement.<form method="GET" action="/en/{{ default_branch }}/search.html?>
For "project not found"
For "subproject page not found"
For "translation not found"
For "readthedocs.org page not found"
References #2551
📚 Documentation previews 📚
docs
): https://docs--9657.org.readthedocs.build/en/9657/dev
): https://dev--9657.org.readthedocs.build/en/9657/