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

add a custom 404 page #55

Merged
merged 1 commit into from
Jul 27, 2023
Merged

add a custom 404 page #55

merged 1 commit into from
Jul 27, 2023

Conversation

ru-fu
Copy link
Contributor

@ru-fu ru-fu commented Jul 10, 2023

Fixes #51.

Unfortunately, the page doesn't display right in the preview (because that uses a different URL structure than the real docs). I tested the paths though, and I'm positive they are correct. :)

@ru-fu ru-fu marked this pull request as draft July 10, 2023 09:25
@ru-fu ru-fu marked this pull request as ready for review July 10, 2023 09:46
Copy link
Contributor

@s-makin s-makin left a comment

Choose a reason for hiding this comment

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

It's possible to specify the page not found text within conf.py - it might be better to do that rather than having an orphan page, simply for ease of configuration (i.e., having all that config in as few places as possible)

@ru-fu
Copy link
Contributor Author

ru-fu commented Jul 11, 2023

It's possible to specify the page not found text within conf.py - it might be better to do that rather than having an orphan page, simply for ease of configuration (i.e., having all that config in as few places as possible)

I felt that blows up the config file, and it's easier to find how to modify the 404 page when having it explicitly as a page.

Maybe the question is whether we want every project to use the same text - then putting it in the conf.py file shoud be okay. But if we want to allow customising it, I find a separate file easier to maintain.

@pmatulis
Copy link

The first question to answer is whether we consider the 404 page a customisable element or not. I don't think it should be and having a separate page would make it tempting for projects to edit it. So my opinion is to hardcode it in conf.py. One customisable aspect could be if the 404 config sourced some image that is a customisable object (in custom_conf.py).

If others do think the 404 page should be customisable, to be 100% consistent with our current approach, we would embed the 404 page in conf.py and then allow for an override in custom_conf.py . So again, no separate page.

Fixes canonical#51.

Signed-off-by: Ruth Fuchss <ruth.fuchss@canonical.com>
@ru-fu
Copy link
Contributor Author

ru-fu commented Jul 27, 2023

Thanks! I don't have any strong opinions, so updated.
For now without an option to override the text, but that should be easy to add if we need it.

@pmatulis pmatulis merged commit d3f01a4 into canonical:main Jul 27, 2023
3 checks passed
@ru-fu ru-fu deleted the 404-page branch July 31, 2023 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a custom 404 page
3 participants