diff options
| author | Alexandre Flament <alex@al-f.net> | 2022-07-02 11:29:21 +0200 |
|---|---|---|
| committer | Alexandre Flament <alex@al-f.net> | 2022-07-02 11:29:21 +0200 |
| commit | f8f239fe1fb0439635086713e9fd2a14d35a70ed (patch) | |
| tree | 4141e30cc51f18ca505aaf2e19e42227a74a9aa2 /searx/webapp.py | |
| parent | da416511b56b6174025656d8431951eb46b1a73b (diff) | |
Donation link: default value to searxng.org, can be hidden or custom
Add a new setting: general.donation_url
By default the value is https://docs.searxng.org/donate.html
When the value is false, the link is hidden
When the value is true, the link goes to the infopage donation,
the administrator can create a custom page.
Diffstat (limited to 'searx/webapp.py')
| -rwxr-xr-x | searx/webapp.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index d4fb1c7dc..151eb5cc6 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -453,6 +453,12 @@ def render(template_name: str, **kwargs): kwargs['get_setting'] = get_setting kwargs['get_pretty_url'] = get_pretty_url + # values from settings: donation_url + donation_url = get_setting('general.donation_url') + if donation_url is True: + donation_url = custom_url_for('info', pagename='donate') + kwargs['donation_url'] = donation_url + # helpers to create links to other pages kwargs['url_for'] = custom_url_for # override url_for function in templates kwargs['image_proxify'] = image_proxify |