diff options
author | Adam Tauber <asciimoo@gmail.com> | 2016-02-27 18:16:40 +0100 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2016-02-27 18:23:55 +0100 |
commit | 0fbd705259c500bb01ec2d649670de2f0a91830a (patch) | |
tree | 46b87eee5b976e1daf65b7096099d151432f531f /searx | |
parent | ead8456a2bb0ae3f9d95ee68e444f446d8d61245 (diff) | |
download | searxng-0fbd705259c500bb01ec2d649670de2f0a91830a.tar.gz searxng-0fbd705259c500bb01ec2d649670de2f0a91830a.zip |
[enh] settings option to change instance name - closes #450
Diffstat (limited to 'searx')
-rw-r--r-- | searx/settings.yml | 1 | ||||
-rw-r--r-- | searx/templates/courgette/opensearch.xml | 2 | ||||
-rw-r--r-- | searx/templates/default/opensearch.xml | 2 | ||||
-rw-r--r-- | searx/templates/oscar/base.html | 4 | ||||
-rw-r--r-- | searx/templates/oscar/navbar.html | 4 | ||||
-rw-r--r-- | searx/templates/oscar/opensearch.xml | 2 | ||||
-rw-r--r-- | searx/webapp.py | 2 |
7 files changed, 10 insertions, 7 deletions
diff --git a/searx/settings.yml b/searx/settings.yml index 7e8182b0f..7607ce94d 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -1,5 +1,6 @@ general: debug : False # Debug mode, only for development + instance_name : "searx" # displayed name search: safe_search : 0 # Filter results. 0: None, 1: Moderate, 2: Strict diff --git a/searx/templates/courgette/opensearch.xml b/searx/templates/courgette/opensearch.xml index b85c3a7f5..b77db61cb 100644 --- a/searx/templates/courgette/opensearch.xml +++ b/searx/templates/courgette/opensearch.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>searx</ShortName> + <ShortName>{{ instance_name }}</ShortName> <Description>a privacy-respecting, hackable metasearch engine</Description> <InputEncoding>UTF-8</InputEncoding> <Image>{{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }}</Image> diff --git a/searx/templates/default/opensearch.xml b/searx/templates/default/opensearch.xml index b85c3a7f5..b77db61cb 100644 --- a/searx/templates/default/opensearch.xml +++ b/searx/templates/default/opensearch.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>searx</ShortName> + <ShortName>{{ instance_name }}</ShortName> <Description>a privacy-respecting, hackable metasearch engine</Description> <InputEncoding>UTF-8</InputEncoding> <Image>{{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }}</Image> diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index a799376f5..2fc3270fc 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -9,7 +9,7 @@ <meta name="referrer" content="no-referrer"> <meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=1.0, user-scalable=1" /> {% block meta %}{% endblock %} - <title>{% block title %}{% endblock %}searx</title> + <title>{% block title %}{% endblock %}{{ instance_name }}</title> <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" type="text/css" /> <link rel="stylesheet" href="{{ url_for('static', filename='css/oscar.min.css') }}" type="text/css" /> @@ -31,7 +31,7 @@ {% block head %} {% endblock %} - <link title="searx" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> + <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> <script type="text/javascript"> searx = {}; diff --git a/searx/templates/oscar/navbar.html b/searx/templates/oscar/navbar.html index 0c92b09dd..c59bcda3d 100644 --- a/searx/templates/oscar/navbar.html +++ b/searx/templates/oscar/navbar.html @@ -16,7 +16,7 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - <a class="navbar-brand" href="{{ url_for('index') }}">searx</a> + <a class="navbar-brand" href="{{ url_for('index') }}">{{ instance_name }}</a> </div> {% else %} <div class="navbar-header"> @@ -26,7 +26,7 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - <a class="navbar-brand" href="{{ url_for('index') }}">searx</a> + <a class="navbar-brand" href="{{ url_for('index') }}">{{ instance_name }}</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <!-- results.html --> diff --git a/searx/templates/oscar/opensearch.xml b/searx/templates/oscar/opensearch.xml index b85c3a7f5..b77db61cb 100644 --- a/searx/templates/oscar/opensearch.xml +++ b/searx/templates/oscar/opensearch.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>searx</ShortName> + <ShortName>{{ instance_name }}</ShortName> <Description>a privacy-respecting, hackable metasearch engine</Description> <InputEncoding>UTF-8</InputEncoding> <Image>{{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }}</Image> diff --git a/searx/webapp.py b/searx/webapp.py index 71d65aa82..06859b847 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -328,6 +328,8 @@ def render(template_name, override_theme=None, **kwargs): kwargs['cookies'] = request.cookies + kwargs['instance_name'] = settings['general']['instance_name'] + kwargs['scripts'] = set() for plugin in request.user_plugins: for script in plugin.js_dependencies: |