Skip to content

Commit

Permalink
fix(docs): add 404 page generation
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxiao committed Jun 18, 2020
1 parent 22f29e3 commit a579df5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
20 changes: 17 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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')]
Expand All @@ -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': '''
<h1>Page Not Found</h1>
<p>Sorry, we couldn't find that page.</p>
<p>Try using the search box or go to the homepage.</p>
''',
}
notfound_no_urls_prefix = True

apidoc_module_dir = '../jina/'
apidoc_output_dir = 'api'
apidoc_excluded_paths = ['tests', 'legacy']
Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
sphinx_copybutton==0.2.10
sphinx-notfound-page==0.4

0 comments on commit a579df5

Please sign in to comment.