Skip to content
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

Show some useful links on 404 default page #5091

Closed
wants to merge 1 commit into from

Conversation

humitos
Copy link
Member

@humitos humitos commented Jan 10, 2019

NOTE: this is a POC to discuss what we want to show on this page. Do not merge yet.

With these changes, I'm adding

  • default site documentation (based on default version and language)
  • the root of the current version and language
  • the current page requested that produces the 404

I'd like to add some style to it and show a message similar to

The page /en/auto-wipe/notfound you requested does not exist. You can access the full documentation at {{ default site docs }}.

This way, lost readers will be able to "stay on the project's docs" instead of need to manually manipulate the URL to remove some parts.

captura de pantalla_2019-01-10_16-27-08

Closes #2551

@humitos humitos requested a review from a team January 10, 2019 15:27
@agjohnson agjohnson added Needed: design decision A core team decision is required PR: work in progress Pull request is not ready for full review labels Jan 10, 2019
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful approach. Definitely needs some styling love :)

language = None
version_slug = None

full_path = request.get_full_path()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this suffer from the Django security issue they just patched? django/django@1cd00fc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but we aren't calling urlquote, which is the fix for the path issue.

@humitos humitos self-assigned this Jan 15, 2019
@humitos
Copy link
Member Author

humitos commented Feb 6, 2019

Closing this PR in favor of #5130. With that PR merged, the user will be able to write the 404 page by themselves and even use a sphinx extension to easily generate it.

Also, we are thinking on including the extension in the common build process and default a generic message. By doing this, each version will have its own 404 and the menu will link to the proper sections of that version where we are seeing the 404 page.

@humitos humitos closed this Feb 6, 2019
@stsewd stsewd deleted the humitos/useful-links-on-404 branch February 6, 2019 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required PR: work in progress Pull request is not ready for full review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants