summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorPaul Braeuning <paul@paulgo.io>2021-11-23 11:04:34 +0100
committerGitHub <noreply@github.com>2021-11-23 11:04:34 +0100
commita87f1eb9ec318e794c03a2bcb06b084cd69dc1d0 (patch)
tree5908508cb7f95db6afd5d0eb790675fe7799da07 /searx/webapp.py
parentef3f084c498f62d608618c453d74c03aa1019094 (diff)
parentb0aebf7069236ba53078b7d5adf6c678df56693b (diff)
Merge pull request #510 from mrpaulblack/result-article-improvments
[simple theme] rework select and impove url
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 4dd7ec723..6039be547 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -419,6 +419,16 @@ def _get_enable_categories(all_categories):
return [x for x in all_categories if x in enabled_categories]
+def get_pretty_url(parsed_url):
+ path = parsed_url.path
+ path = path[:-1] if len(path) > 0 and path[-1] == '/' else path
+ path = path.replace("/", " › ")
+ return [
+ parsed_url.scheme + "://" + parsed_url.netloc,
+ path
+ ]
+
+
def render(template_name, override_theme=None, **kwargs):
# values from the HTTP requests
kwargs['endpoint'] = 'results' if 'q' in kwargs else request.endpoint
@@ -457,6 +467,7 @@ def render(template_name, override_theme=None, **kwargs):
kwargs['searx_version'] = VERSION_STRING
kwargs['searx_git_url'] = GIT_URL
kwargs['get_setting'] = get_setting
+ kwargs['get_pretty_url'] = get_pretty_url
# helpers to create links to other pages
kwargs['url_for'] = url_for_theme # override url_for function in templates