Merge pull request #973 from alphagov/remove-documentation

Remove documentation pages
This commit is contained in:
Chris Hill-Scott
2016-10-10 16:01:09 +01:00
committed by GitHub
5 changed files with 22 additions and 392 deletions

View File

@@ -384,10 +384,14 @@ def register_errorhandlers(application):
error.message
))
error_code = error.status_code
if error_code not in [401, 404, 403, 500]:
if error_code not in [401, 404, 403, 410, 500]:
error_code = 500
return _error_response(error_code)
@application.errorhandler(410)
def handle_gone(error):
return _error_response(410)
@application.errorhandler(404)
def handle_not_found(error):
return _error_response(404)

View File

@@ -1,6 +1,6 @@
import markdown
import os
from flask import (render_template, url_for, redirect, Markup, request)
from flask import (render_template, url_for, redirect, Markup, request, abort)
from app.main import main
from app import convert_to_boolean
from flask_login import login_required
@@ -95,12 +95,4 @@ def email_template():
@main.route('/documentation')
def documentation():
curr_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(curr_dir, '../../../docs/index.md'), encoding='utf-8') as source:
return render_template(
'views/documentation.html',
body=Markup(markdown.markdown(
source.read(),
extensions=[GithubFlavoredMarkdownExtension()]
))
)
abort(410)

View File

@@ -0,0 +1,14 @@
{% extends "withoutnav_template.html" %}
{% block page_title %}Page not found{% endblock %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-large">
Page could not be found
</h1>
<p>
Check youve entered the correct web address.
</p>
</div>
</div>
{% endblock %}