Skip to content

Commit ca14616

Browse files
committed
Revert "Use sphinx-notfound-page by default to create a generic 404 page"
This reverts commit 9ac46ef.
1 parent ee2f595 commit ca14616

File tree

4 files changed

+3
-22
lines changed

4 files changed

+3
-22
lines changed

readthedocs/core/views/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def server_error_404(request, exception=None, template_name='404.html'): # pyli
133133
return response
134134

135135
# Try to serve custom 404 pages if it's a subdomain/cname
136-
if getattr(request, 'subdomain', False) or getattr(request, 'cname', False):
136+
if request.subdomain or request.cname:
137137
return server_error_404_subdomain(request, template_name)
138138

139139
# Return the default 404 page generated by Read the Docs

readthedocs/doc_builder/python_environments.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ def install_core_requirements(self):
307307
),
308308
'sphinx-rtd-theme<0.5',
309309
'readthedocs-sphinx-ext<0.6',
310-
'sphinx-notfound-page',
311310
])
312311

313312
cmd = copy.copy(pip_install_cmd)
@@ -430,10 +429,7 @@ def install_core_requirements(self):
430429
if self.config.doctype == 'mkdocs':
431430
pip_requirements.append('mkdocs')
432431
else:
433-
pip_requirements.extend([
434-
'readthedocs-sphinx-ext',
435-
'sphinx-notfound-page',
436-
])
432+
pip_requirements.append('readthedocs-sphinx-ext')
437433
requirements.extend(['sphinx', 'sphinx_rtd_theme'])
438434

439435
cmd = [
@@ -447,7 +443,7 @@ def install_core_requirements(self):
447443
cmd.extend(requirements)
448444
self.build_env.run(
449445
*cmd,
450-
cwd=self.checkout_path,
446+
cwd=self.checkout_path # noqa - no comma here in py27 :/
451447
)
452448

453449
pip_cmd = [

readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,3 @@ if 'extensions' in globals():
140140
extensions.insert(0, "readthedocs_ext.readthedocs")
141141
else:
142142
extensions = ["readthedocs_ext.readthedocs"]
143-
144-
145-
# Define default 404 page body
146-
if 'notfound_context' not in globals():
147-
notfound_context = {
148-
'body': '''
149-
<h1>Page not found</h1>
150-
151-
<p>Sorry, we couldn't find that page.</p>
152-
153-
<p>Try using the search box or go to the homepage.</p>
154-
''',
155-
}

readthedocs/rtd_tests/tests/test_doc_building.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,6 @@ def test_install_core_requirements_sphinx(self, checkout_path):
12291229
'sphinx',
12301230
'sphinx-rtd-theme',
12311231
'readthedocs-sphinx-ext',
1232-
'sphinx-notfound-page',
12331232
]
12341233
requirements = self.base_requirements + requirements_sphinx
12351234
args = self.pip_install_args + requirements
@@ -1357,7 +1356,6 @@ def test_install_core_requirements_sphinx_conda(self, checkout_path):
13571356
pip_requirements = [
13581357
'recommonmark',
13591358
'readthedocs-sphinx-ext',
1360-
'sphinx-notfound-page',
13611359
]
13621360

13631361
args_pip = [

0 commit comments

Comments
 (0)