commit: 0fbd705259c500bb01ec2d649670de2f0a91830a
parent: ead8456a2bb0ae3f9d95ee68e444f446d8d61245
Author: Adam Tauber <asciimoo@gmail.com>
Date: Sat, 27 Feb 2016 18:16:40 +0100
[enh] settings option to change instance name - closes #450
Diffstat:
7 files changed, 10 insertions(+), 7 deletions(-)
diff --git 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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: