From 2bfc2f04cff2e83cc0f803451ce9abcfb48c3185 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 28 Apr 2025 19:03:08 +0200 Subject: [PATCH] Hide user notes on 404 page This switches to `404.rst` instead of an embedded 404 page in `conf.py`, so we can specify page metadata. --- 404.rst | 24 ++++++++++++++++++++++++ conf.py | 23 ----------------------- 2 files changed, 24 insertions(+), 23 deletions(-) create mode 100644 404.rst diff --git a/404.rst b/404.rst new file mode 100644 index 000000000..21960757c --- /dev/null +++ b/404.rst @@ -0,0 +1,24 @@ +:github_url: hide +:allow_comments: False + +Page not found +============== + +.. https://github.com/readthedocs/sphinx-notfound-page + +.. raw:: html + +

+ Sorry, we couldn't find that page. It may have been renamed or removed + in the version of the documentation you're currently browsing. +

+

+ If you're currently browsing the + latest version of the documentation, try browsing the + stable version of the documentation. +

+

+ Alternatively, use the + Search docs + box on the left or go to the homepage. +

diff --git a/conf.py b/conf.py index 939ac5d75..8bb70accb 100644 --- a/conf.py +++ b/conf.py @@ -29,29 +29,6 @@ sphinx_tabs_nowarn = True # Disable collapsing tabs for codeblocks. sphinx_tabs_disable_tab_closing = True -# Custom 4O4 page HTML template. -# https://github.com/readthedocs/sphinx-notfound-page -notfound_context = { - "title": "Page not found", - "body": """ -

Page not found

-

- Sorry, we couldn't find that page. It may have been renamed or removed - in the version of the documentation you're currently browsing. -

-

- If you're currently browsing the - latest version of the documentation, try browsing the - stable version of the documentation. -

-

- Alternatively, use the - Search docs - box on the left or go to the homepage. -

- """, -} - # on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org on_rtd = os.environ.get("READTHEDOCS", None) == "True"