From d4529b126bb69078b8b3153c1208d36509e229b4 Mon Sep 17 00:00:00 2001 From: Kristal Dale Date: Fri, 4 Oct 2019 09:38:41 -0700 Subject: [PATCH] Add custom 404 and 403 pages. (#841) - Added static html pages for 404 and 403 server responses. - Added conf.py setting html_extra_path to copy static _errors folder with static 404/403 files into build output Signed-off-by: Kristal Dale --- source/_html_extra/_errors/403.html | 79 +++++++++++++++++++++++++++++ source/_html_extra/_errors/404.html | 79 +++++++++++++++++++++++++++++ source/conf.py | 2 +- 3 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 source/_html_extra/_errors/403.html create mode 100644 source/_html_extra/_errors/404.html diff --git a/source/_html_extra/_errors/403.html b/source/_html_extra/_errors/403.html new file mode 100644 index 00000000..a3a5f979 --- /dev/null +++ b/source/_html_extra/_errors/403.html @@ -0,0 +1,79 @@ + + + + + Page Not Found + + + + + + + + +

403 Forbidden

+

Sorry, looks like you don't have permission to access this page.

+

Please go back to the documentation home page or try searching:

+ +
+
+ + + +
+
+ + diff --git a/source/_html_extra/_errors/404.html b/source/_html_extra/_errors/404.html new file mode 100644 index 00000000..d1487bc5 --- /dev/null +++ b/source/_html_extra/_errors/404.html @@ -0,0 +1,79 @@ + + + + + Page Not Found + + + + + + + + +

404 Not Found

+

Sorry, we didn't find the page you're looking for.

+

Please go back to the documentation home page or try searching:

+ +
+
+ + + +
+
+ + diff --git a/source/conf.py b/source/conf.py index 8893d0e6..f2da0a51 100644 --- a/source/conf.py +++ b/source/conf.py @@ -178,7 +178,7 @@ html_favicon = '_images/favicon.ico' # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. -#html_extra_path = [] +html_extra_path = ['_html_extra'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format.