summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-01-31 11:24:45 +0100
committerMartin Fischer <martin@push-f.com>2022-02-01 06:28:26 +0100
commitfb9eedbf40410a5558bfc03b4c50f7ff41b023b4 (patch)
tree1b722cca8af208f9e267cd3b1e18fc26a89cc759 /searx/webapp.py
parentb93711b45da7e8d851be5a3d55ebf6fbe5423efd (diff)
[enh] introduce /help route
Translation will be implemented in the future. For now the "en" in /help/en/<pagename> is hardcoded.
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 2e6e388e5..bd296cddc 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -877,8 +877,19 @@ def __get_translated_errors(unresponsive_engines: Iterable[UnresponsiveEngine]):
@app.route('/about', methods=['GET'])
def about():
- """Render about page"""
- return render('about.html', help=user_help.HELP)
+ """Redirect to about page"""
+ return redirect(url_for('help_page', pagename='about'))
+
+
+@app.route('/help/en/<pagename>', methods=['GET'])
+def help_page(pagename):
+ """Render help page"""
+ page = user_help.PAGES.get(pagename)
+
+ if page is None:
+ flask.abort(404)
+
+ return render('help.html', page=user_help.PAGES[pagename])
@app.route('/autocompleter', methods=['GET', 'POST'])