From a579df5dfe7ede825113bbf9e75f9c0e67cd5719 Mon Sep 17 00:00:00 2001 From: Han Xiao Date: Thu, 18 Jun 2020 23:11:59 +0200 Subject: [PATCH] fix(docs): add 404 page generation --- docs/conf.py | 20 +++++++++++++++++--- docs/requirements.txt | 3 ++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 52abf431c958d..efa702246658c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,7 +34,7 @@ html_theme = 'sphinx_rtd_theme' html_theme_options = { # 'canonical_url': '', - 'analytics_id': 'UA-164627626-3', # Provided by Google in your dashboard + 'analytics_id': 'UA-164627626-3', # Provided by Google in your dashboard 'logo_only': True, 'display_version': True, # 'prev_next_buttons_location': 'bottom', @@ -56,7 +56,6 @@ htmlhelp_basename = slug html_show_sourcelink = False - latex_documents = [(master_doc, f'{slug}.tex', project, author, 'manual')] man_pages = [(master_doc, slug, project, [author], 1)] texinfo_documents = [(master_doc, slug, project, author, slug, project, 'Miscellaneous')] @@ -74,9 +73,24 @@ 'sphinx_rtd_theme', 'recommonmark', 'sphinx_markdown_tables', - 'sphinx_copybutton' + 'sphinx_copybutton', + 'notfound.extension', ] +# -- Custom 404 page + +# sphinx-notfound-page +# https://github.com/readthedocs/sphinx-notfound-page +notfound_context = { + 'title': 'Page Not Found', + 'body': ''' +

Page Not Found

+

Sorry, we couldn't find that page.

+

Try using the search box or go to the homepage.

+''', +} +notfound_no_urls_prefix = True + apidoc_module_dir = '../jina/' apidoc_output_dir = 'api' apidoc_excluded_paths = ['tests', 'legacy'] diff --git a/docs/requirements.txt b/docs/requirements.txt index 16baf42cbefd4..97df04a4bbb2f 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -5,4 +5,5 @@ sphinx-autodoc-typehints==1.10.3 sphinx_rtd_theme==0.4.3 recommonmark==0.6.0 sphinx_markdown_tables==0.0.12 -sphinx_copybutton==0.2.10 \ No newline at end of file +sphinx_copybutton==0.2.10 +sphinx-notfound-page==0.4 \ No newline at end of file