瀏覽代碼

[mod] add a __common__ template that can't be selected but that provides a common place for shared templates.

What has been moved into this template :
* opensearch*.xml is always the same whatever the themes.
* the text inside */about.html
Alexandre Flament 8 年之前
父節點
當前提交
7fdfeca3a4

+ 62
- 0
searx/templates/__common__/about.html 查看文件

@@ -0,0 +1,62 @@
1
+<div{% if rtl %} dir="ltr"{% endif %}>
2
+    <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
3
+
4
+    <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
5
+    </p>
6
+    <h2>Why use searx?</h2>
7
+    <ul>
8
+        <li>searx may not offer you as personalised results as Google, but it doesn't generate a profile about you</li>
9
+        <li>searx doesn't care about what you search for, never shares anything with a third party, and it can't be used to compromise you</li>
10
+        <li>searx is free software, the code is 100% open and you can help to make it better. See more on <a href="https://github.com/asciimoo/searx">github</a></li>
11
+    </ul>
12
+    <p>If you do care about privacy, want to be a conscious user, or otherwise believe
13
+    in digital freedom, make searx your default search engine or run it on your own server</p>
14
+
15
+<h2>Technical details - How does it work?</h2>
16
+
17
+<p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>,
18
+inspired by the <a href="https://beniz.github.io/seeks/">seeks project</a>.<br />
19
+It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrome*). Therefore they show up in neither our logs, nor your url history. In case of Chrome* users there is an exception, searx uses the search bar to perform GET requests.<br />
20
+Searx can be added to your browser's search bar; moreover, it can be set as the default search engine.
21
+</p>
22
+
23
+<h2>How can I make it my own?</h2>
24
+
25
+<p>Searx appreciates your concern regarding logs, so take the <a href="https://github.com/asciimoo/searx">code</a> and run it yourself! <br />Add your Searx to this <a href="https://github.com/asciimoo/searx/wiki/Searx-instances">list</a> to help other people reclaim their privacy and make the Internet freer!
26
+<br />The more decentralized the Internet is, the more freedom we have!</p>
27
+
28
+
29
+<h2>More about searx</h2>
30
+
31
+<ul>
32
+    <li><a href="https://github.com/asciimoo/searx">github</a></li>
33
+    <li><a href="https://www.ohloh.net/p/searx/">ohloh</a></li>
34
+    <li><a href="https://twitter.com/Searx_engine">twitter</a></li>
35
+    <li>IRC: #searx @ freenode (<a href="https://kiwiirc.com/client/irc.freenode.com/searx">webclient</a>)</li>
36
+    <li><a href="https://www.transifex.com/projects/p/searx/">transifex</a></li>
37
+</ul>
38
+
39
+
40
+<hr />
41
+
42
+<h2 id="faq">FAQ</h2>
43
+
44
+<h3>How to add to firefox?</h3>
45
+<p><a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a> searx as a search engine on any version of Firefox! (javascript required)</p>
46
+
47
+<h2 id="dev_faq">Developer FAQ</h2>
48
+
49
+<h3>New engines?</h3>
50
+<ul>
51
+    <li>Edit your <a href="https://raw.github.com/asciimoo/searx/master/searx/settings.yml">settings.yml</a></li>
52
+    <li>Create your custom engine module, check the <a href="https://github.com/asciimoo/searx/blob/master/examples/basic_engine.py">example engine</a></li>
53
+</ul>
54
+<p>Don't forget to restart searx after config edit!</p>
55
+
56
+<h3>Installation/WSGI support?</h3>
57
+<p>See the <a href="https://github.com/asciimoo/searx/wiki/Installation">installation and setup</a> wiki page</p>
58
+
59
+<h3>How to debug engines?</h3>
60
+<p><a href="{{ url_for('stats') }}">Stats page</a> contains some useful data about the engines used.</p>
61
+
62
+</div>

searx/templates/oscar/opensearch.xml → searx/templates/__common__/opensearch.xml 查看文件


searx/templates/oscar/opensearch_response_rss.xml → searx/templates/__common__/opensearch_response_rss.xml 查看文件


+ 1
- 62
searx/templates/courgette/about.html 查看文件

@@ -1,66 +1,5 @@
1 1
 {% extends 'courgette/base.html' %}
2 2
 {% block content %}
3 3
 {% include 'courgette/github_ribbon.html' %}
4
-<div class="row"{% if rtl %} dir="ltr"{% endif %}>
5
-    <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
6
-
7
-    <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
8
-    </p>
9
-    <h2>Why use searx?</h2>
10
-    <ul>
11
-        <li>searx may not offer you as personalised results as Google, but it doesn't generate a profile about you</li>
12
-        <li>searx doesn't care about what you search for, never shares anything with a third party, and it can't be used to compromise you</li>
13
-        <li>searx is free software, the code is 100% open and you can help to make it better. See more on <a href="https://github.com/asciimoo/searx">github</a></li>
14
-    </ul>
15
-    <p>If you do care about privacy, want to be a conscious user, or otherwise believe
16
-    in digital freedom, make searx your default search engine or run it on your own server</p>
17
-
18
-<h2>Technical details - How does it work?</h2>
19
-
20
-<p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>,
21
-inspired by the <a href="https://beniz.github.io/seeks/">seeks project</a>.<br />
22
-It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrome*). Therefore they show up in neither our logs, nor your url history. In case of Chrome* users there is an exception, searx uses the search bar to perform GET requests.<br />
23
-Searx can be added to your browser's search bar; moreover, it can be set as the default search engine.
24
-</p>
25
-
26
-<h2>How can I make it my own?</h2>
27
-
28
-<p>Searx appreciates your concern regarding logs, so take the <a href="https://github.com/asciimoo/searx">code</a> and run it yourself! <br />Add your Searx to this <a href="https://github.com/asciimoo/searx/wiki/Searx-instances">list</a> to help other people reclaim their privacy and make the Internet freer!
29
-<br />The more decentralized the Internet, is the more freedom we have!</p>
30
-
31
-
32
-<h2>More about searx</h2>
33
-
34
-<ul>
35
-    <li><a href="https://github.com/asciimoo/searx">github</a></li>
36
-    <li><a href="https://www.ohloh.net/p/searx/">ohloh</a></li>
37
-    <li><a href="https://twitter.com/Searx_engine">twitter</a></li>
38
-    <li>IRC: #searx @ freenode (<a href="https://kiwiirc.com/client/irc.freenode.com/searx">webclient</a>)</li>
39
-    <li><a href="https://www.transifex.com/projects/p/searx/">transifex</a></li>
40
-</ul>
41
-
42
-
43
-<hr />
44
-
45
-<h2 id="faq">FAQ</h2>
46
-
47
-<h3>How to add to firefox?</h3>
48
-<p><a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a> searx as a search engine on any version of Firefox! (javascript required)</p>
49
-
50
-<h2 id="dev_faq">Developer FAQ</h2>
51
-
52
-<h3>New engines?</h3>
53
-<ul>
54
-    <li>Edit your <a href="https://raw.github.com/asciimoo/searx/master/searx/settings.yml">settings.yml</a></li>
55
-    <li>Create your custom engine module, check the <a href="https://github.com/asciimoo/searx/blob/master/examples/basic_engine.py">example engine</a></li>
56
-</ul>
57
-<p>Don't forget to restart searx after config edit!</p>
58
-
59
-<h3>Installation/WSGI support?</h3>
60
-<p>See the <a href="https://github.com/asciimoo/searx/wiki/Installation">installation and setup</a> wiki page</p>
61
-
62
-<h3>How to debug engines?</h3>
63
-<p><a href="{{ url_for('stats') }}">Stats page</a> contains some useful data about the engines used.</p>
64
-
65
-</div>
4
+{% include '__common__/about.html' %}
66 5
 {% endblock %}

+ 0
- 28
searx/templates/courgette/opensearch.xml 查看文件

@@ -1,28 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
3
-  <ShortName>{{ instance_name }}</ShortName>
4
-  <Description>a privacy-respecting, hackable metasearch engine</Description>
5
-  <InputEncoding>UTF-8</InputEncoding>
6
-  <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
7
-  <LongName>searx metasearch</LongName>
8
-  {% if opensearch_method == 'get' %}
9
-    <Url type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
10
-    {% if autocomplete %}
11
-    <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
12
-        <Param name="format" value="x-suggestions" />
13
-        <Param name="q" value="{searchTerms}" />
14
-    </Url>
15
-    {% endif %}
16
-  {% else %}
17
-    <Url type="text/html" method="post" template="{{ host }}">
18
-        <Param name="q" value="{searchTerms}" />
19
-    </Url>
20
-    {% if autocomplete %}
21
-    <!-- TODO, POST REQUEST doesn't work -->
22
-    <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
23
-        <Param name="format" value="x-suggestions" />
24
-        <Param name="q" value="{searchTerms}" />
25
-    </Url>
26
-    {% endif %}
27
-  {% endif %}
28
-</OpenSearchDescription>

+ 0
- 23
searx/templates/courgette/opensearch_response_rss.xml 查看文件

@@ -1,23 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<rss version="2.0"
3
-     xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
4
-     xmlns:atom="http://www.w3.org/2005/Atom">
5
-  <channel>
6
-    <title>Searx search: {{ q|e }}</title>
7
-    <link>{{ base_url }}?q={{ q|e }}</link>
8
-    <description>Search results for "{{ q|e }}" - searx</description>
9
-    <opensearch:totalResults>{{ number_of_results }}</opensearch:totalResults>
10
-    <opensearch:startIndex>1</opensearch:startIndex>
11
-    <opensearch:itemsPerPage>{{ number_of_results }}</opensearch:itemsPerPage>
12
-    <atom:link rel="search" type="application/opensearchdescription+xml" href="{{ base_url }}opensearch.xml"/>
13
-    <opensearch:Query role="request" searchTerms="{{ q|e }}" startPage="1" />
14
-    {% for r in results %}
15
-    <item>
16
-      <title>{{ r.title }}</title>
17
-      <link>{{ r.url }}</link>
18
-      <description>{{ r.content }}</description>
19
-      {% if r.pubdate %}<pubDate>{{ r.pubdate }}</pubDate>{% endif %}
20
-    </item>
21
-    {% endfor %}
22
-  </channel>
23
-</rss>

+ 1
- 62
searx/templates/legacy/about.html 查看文件

@@ -1,66 +1,5 @@
1 1
 {% extends 'legacy/base.html' %}
2 2
 {% block content %}
3 3
 {% include 'legacy/github_ribbon.html' %}
4
-<div class="row"{% if rtl %} dir="ltr"{% endif %}>
5
-    <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
6
-
7
-    <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
8
-    </p>
9
-    <h2>Why use searx?</h2>
10
-    <ul>
11
-        <li>searx may not offer you as personalised results as Google, but it doesn't generate a profile about you</li>
12
-        <li>searx doesn't care about what you search for, never shares anything with a third party, and it can't be used to compromise you</li>
13
-        <li>searx is free software, the code is 100% open and you can help to make it better. See more on <a href="https://github.com/asciimoo/searx">github</a></li>
14
-    </ul>
15
-    <p>If you do care about privacy, want to be a conscious user, or otherwise believe
16
-    in digital freedom, make searx your default search engine or run it on your own server</p>
17
-
18
-<h2>Technical details - How does it work?</h2>
19
-
20
-<p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>,
21
-inspired by the <a href="https://beniz.github.io/seeks/">seeks project</a>.<br />
22
-It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrome*). Therefore they show up in neither our logs, nor your url history. In case of Chrome* users there is an exception, if searx used from the search bar it performs GET requests.<br />
23
-Searx can be added to your browser's search bar; moreover, it can be set as the default search engine.
24
-</p>
25
-
26
-<h2>How can I make it my own?</h2>
27
-
28
-<p>Searx appreciates your concern regarding logs, so take the <a href="https://github.com/asciimoo/searx">code</a> and run it yourself! <br />Add your Searx to this <a href="https://github.com/asciimoo/searx/wiki/Searx-instances">list</a> to help other people reclaim their privacy and make the Internet freer!
29
-<br />The more decentralized Internet is the more freedom we have!</p>
30
-
31
-
32
-<h2>More about searx</h2>
33
-
34
-<ul>
35
-    <li><a href="https://github.com/asciimoo/searx">github</a></li>
36
-    <li><a href="https://www.ohloh.net/p/searx/">ohloh</a></li>
37
-    <li><a href="https://twitter.com/Searx_engine">twitter</a></li>
38
-    <li>IRC: #searx @ freenode (<a href="https://kiwiirc.com/client/irc.freenode.com/searx">webclient</a>)</li>
39
-    <li><a href="https://www.transifex.com/projects/p/searx/">transifex</a></li>
40
-</ul>
41
-
42
-
43
-<hr />
44
-
45
-<h2 id="faq">FAQ</h2>
46
-
47
-<h3>How to add to firefox?</h3>
48
-<p><a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a> searx as a search engine on any version of Firefox! (javascript required)</p>
49
-
50
-<h2 id="dev_faq">Developer FAQ</h2>
51
-
52
-<h3>New engines?</h3>
53
-<ul>
54
-    <li>Edit your <a href="https://raw.github.com/asciimoo/searx/master/searx/settings.yml">settings.yml</a></li>
55
-    <li>Create your custom engine module, check the <a href="https://github.com/asciimoo/searx/blob/master/examples/basic_engine.py">example engine</a></li>
56
-</ul>
57
-<p>Don't forget to restart searx after config edit!</p>
58
-
59
-<h3>Installation/WSGI support?</h3>
60
-<p>See the <a href="https://github.com/asciimoo/searx/wiki/Installation">installation and setup</a> wiki page</p>
61
-
62
-<h3>How to debug engines?</h3>
63
-<p><a href="{{ url_for('stats') }}">Stats page</a> contains some useful data about the engines used.</p>
64
-
65
-</div>
4
+{% include '__common__/about.html' %}
66 5
 {% endblock %}

+ 0
- 28
searx/templates/legacy/opensearch.xml 查看文件

@@ -1,28 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
3
-  <ShortName>{{ instance_name }}</ShortName>
4
-  <Description>a privacy-respecting, hackable metasearch engine</Description>
5
-  <InputEncoding>UTF-8</InputEncoding>
6
-  <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
7
-  <LongName>searx metasearch</LongName>
8
-  {% if opensearch_method == 'get' %}
9
-    <Url type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
10
-    {% if autocomplete %}
11
-    <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
12
-        <Param name="format" value="x-suggestions" />
13
-        <Param name="q" value="{searchTerms}" />
14
-    </Url>
15
-    {% endif %}
16
-  {% else %}
17
-    <Url type="text/html" method="post" template="{{ host }}">
18
-        <Param name="q" value="{searchTerms}" />
19
-    </Url>
20
-    {% if autocomplete %}
21
-    <!-- TODO, POST REQUEST doesn't work -->
22
-    <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
23
-        <Param name="format" value="x-suggestions" />
24
-        <Param name="q" value="{searchTerms}" />
25
-    </Url>
26
-    {% endif %}
27
-  {% endif %}
28
-</OpenSearchDescription>

+ 0
- 23
searx/templates/legacy/opensearch_response_rss.xml 查看文件

@@ -1,23 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<rss version="2.0"
3
-     xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
4
-     xmlns:atom="http://www.w3.org/2005/Atom">
5
-  <channel>
6
-    <title>Searx search: {{ q|e }}</title>
7
-    <link>{{ base_url }}?q={{ q|e }}</link>
8
-    <description>Search results for "{{ q|e }}" - searx</description>
9
-    <opensearch:totalResults>{{ number_of_results }}</opensearch:totalResults>
10
-    <opensearch:startIndex>1</opensearch:startIndex>
11
-    <opensearch:itemsPerPage>{{ number_of_results }}</opensearch:itemsPerPage>
12
-    <atom:link rel="search" type="application/opensearchdescription+xml" href="{{ base_url }}opensearch.xml"/>
13
-    <opensearch:Query role="request" searchTerms="{{ q|e }}" startPage="1" />
14
-    {% for r in results %}
15
-    <item>
16
-      <title>{{ r.title }}</title>
17
-      <link>{{ r.url }}</link>
18
-      <description>{{ r.content }}</description>
19
-      {% if r.pubdate %}<pubDate>{{ r.pubdate }}</pubDate>{% endif %}
20
-    </item>
21
-    {% endfor %}
22
-  </channel>
23
-</rss>

+ 1
- 62
searx/templates/oscar/about.html 查看文件

@@ -1,66 +1,5 @@
1 1
 {% extends "oscar/base.html" %}
2 2
 {% block title %}{{ _('about') }} - {% endblock %}
3 3
 {% block content %}
4
-<div{% if rtl %} dir="ltr"{% endif %}>
5
-    <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
6
-
7
-    <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
8
-    </p>
9
-    <h2>Why use searx?</h2>
10
-    <ul>
11
-        <li>searx may not offer you as personalised results as Google, but it doesn't generate a profile about you</li>
12
-        <li>searx doesn't care about what you search for, never shares anything with a third party, and it can't be used to compromise you</li>
13
-        <li>searx is free software, the code is 100% open and you can help to make it better. See more on <a href="https://github.com/asciimoo/searx">github</a></li>
14
-    </ul>
15
-    <p>If you do care about privacy, want to be a conscious user, or otherwise believe
16
-    in digital freedom, make searx your default search engine or run it on your own server</p>
17
-
18
-<h2>Technical details - How does it work?</h2>
19
-
20
-<p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>,
21
-inspired by the <a href="https://beniz.github.io/seeks/">seeks project</a>.<br />
22
-It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrome*). Therefore they show up in neither our logs, nor your url history. In case of Chrome* users there is an exception, searx uses the search bar to perform GET requests.<br />
23
-Searx can be added to your browser's search bar; moreover, it can be set as the default search engine.
24
-</p>
25
-
26
-<h2>How can I make it my own?</h2>
27
-
28
-<p>Searx appreciates your concern regarding logs, so take the <a href="https://github.com/asciimoo/searx">code</a> and run it yourself! <br />Add your Searx to this <a href="https://github.com/asciimoo/searx/wiki/Searx-instances">list</a> to help other people reclaim their privacy and make the Internet freer!
29
-<br />The more decentralized the Internet is, the more freedom we have!</p>
30
-
31
-
32
-<h2>More about searx</h2>
33
-
34
-<ul>
35
-    <li><a href="https://github.com/asciimoo/searx">github</a></li>
36
-    <li><a href="https://www.ohloh.net/p/searx/">ohloh</a></li>
37
-    <li><a href="https://twitter.com/Searx_engine">twitter</a></li>
38
-    <li>IRC: #searx @ freenode (<a href="https://kiwiirc.com/client/irc.freenode.com/searx">webclient</a>)</li>
39
-    <li><a href="https://www.transifex.com/projects/p/searx/">transifex</a></li>
40
-</ul>
41
-
42
-
43
-<hr />
44
-
45
-<h2 id="faq">FAQ</h2>
46
-
47
-<h3>How to add to firefox?</h3>
48
-<p><a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a> searx as a search engine on any version of Firefox! (javascript required)</p>
49
-
50
-<h2 id="dev_faq">Developer FAQ</h2>
51
-
52
-<h3>New engines?</h3>
53
-<ul>
54
-    <li>Edit your <a href="https://raw.github.com/asciimoo/searx/master/searx/settings.yml">settings.yml</a></li>
55
-    <li>Create your custom engine module, check the <a href="https://github.com/asciimoo/searx/blob/master/examples/basic_engine.py">example engine</a></li>
56
-</ul>
57
-<p>Don't forget to restart searx after config edit!</p>
58
-
59
-<h3>Installation/WSGI support?</h3>
60
-<p>See the <a href="https://github.com/asciimoo/searx/wiki/Installation">installation and setup</a> wiki page</p>
61
-
62
-<h3>How to debug engines?</h3>
63
-<p><a href="{{ url_for('stats') }}">Stats page</a> contains some useful data about the engines used.</p>
64
-
65
-</div>
4
+{% include '__common__/about.html' %}
66 5
 {% endblock %}

+ 1
- 62
searx/templates/pix-art/about.html 查看文件

@@ -1,65 +1,4 @@
1 1
 {% extends 'pix-art/base.html' %}
2 2
 {% block content %}
3
-<div class="row"{% if rtl %} dir="ltr"{% endif %}>
4
-    <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
5
-
6
-    <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
7
-    </p>
8
-    <h2>Why use searx?</h2>
9
-    <ul>
10
-        <li>searx may not offer you as personalised results as Google, but it doesn't generate a profile about you</li>
11
-        <li>searx doesn't care about what you search for, never shares anything with a third party, and it can't be used to compromise you</li>
12
-        <li>searx is free software, the code is 100% open and you can help to make it better. See more on <a href="https://github.com/asciimoo/searx">github</a></li>
13
-    </ul>
14
-    <p>If you do care about privacy, want to be a conscious user, or otherwise believe
15
-    in digital freedom, make searx your default search engine or run it on your own server</p>
16
-
17
-<h2>Technical details - How does it work?</h2>
18
-
19
-<p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>,
20
-inspired by the <a href="https://beniz.github.io/seeks/">seeks project</a>.<br />
21
-It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrome*). Therefore they show up in neither our logs, nor your url history. In case of Chrome* users there is an exception, if searx used from the search bar it performs GET requests.<br />
22
-Searx can be added to your browser's search bar; moreover, it can be set as the default search engine.
23
-</p>
24
-
25
-<h2>How can I make it my own?</h2>
26
-
27
-<p>Searx appreciates your concern regarding logs, so take the <a href="https://github.com/asciimoo/searx">code</a> and run it yourself! <br />Add your Searx to this <a href="https://github.com/asciimoo/searx/wiki/Searx-instances">list</a> to help other people reclaim their privacy and make the Internet freer!
28
-<br />The more decentralized Internet is the more freedom we have!</p>
29
-
30
-
31
-<h2>More about searx</h2>
32
-
33
-<ul>
34
-    <li><a href="https://github.com/asciimoo/searx">github</a></li>
35
-    <li><a href="https://www.ohloh.net/p/searx/">ohloh</a></li>
36
-    <li><a href="https://twitter.com/Searx_engine">twitter</a></li>
37
-    <li>IRC: #searx @ freenode (<a href="https://kiwiirc.com/client/irc.freenode.com/searx">webclient</a>)</li>
38
-    <li><a href="https://www.transifex.com/projects/p/searx/">transifex</a></li>
39
-</ul>
40
-
41
-
42
-<hr />
43
-
44
-<h2 id="faq">FAQ</h2>
45
-
46
-<h3>How to add to firefox?</h3>
47
-<p><a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a> searx as a search engine on any version of Firefox! (javascript required)</p>
48
-
49
-<h2 id="dev_faq">Developer FAQ</h2>
50
-
51
-<h3>New engines?</h3>
52
-<ul>
53
-    <li>Edit your <a href="https://raw.github.com/asciimoo/searx/master/searx/settings.yml">settings.yml</a></li>
54
-    <li>Create your custom engine module, check the <a href="https://github.com/asciimoo/searx/blob/master/examples/basic_engine.py">example engine</a></li>
55
-</ul>
56
-<p>Don't forget to restart searx after config edit!</p>
57
-
58
-<h3>Installation/WSGI support?</h3>
59
-<p>See the <a href="https://github.com/asciimoo/searx/wiki/Installation">installation and setup</a> wiki page</p>
60
-
61
-<h3>How to debug engines?</h3>
62
-<p><a href="{{ url_for('stats') }}">Stats page</a> contains some useful data about the engines used.</p>
63
-
64
-</div>
3
+{% include '__common__/about.html' %}
65 4
 {% endblock %}

+ 2
- 0
searx/utils.py 查看文件

@@ -175,6 +175,8 @@ def get_themes(root):
175 175
     templates_path = os.path.join(root, 'templates')
176 176
 
177 177
     themes = os.listdir(os.path.join(static_path, 'themes'))
178
+    if '__common__' in themes:
179
+        themes.remove('__common__')
178 180
     return static_path, templates_path, themes
179 181
 
180 182
 

+ 5
- 3
searx/webapp.py 查看文件

@@ -226,7 +226,7 @@ def get_current_theme_name(override=None):
226 226
     2. cookies
227 227
     3. settings"""
228 228
 
229
-    if override and override in themes:
229
+    if override and (override in themes or override == '__common__'):
230 230
         return override
231 231
     theme_name = request.args.get('theme', request.preferences.get_value('theme'))
232 232
     if theme_name not in themes:
@@ -501,7 +501,8 @@ def index():
501 501
             results=results,
502 502
             q=request.form['q'],
503 503
             number_of_results=number_of_results,
504
-            base_url=get_base_url()
504
+            base_url=get_base_url(),
505
+            override_theme='__common__',
505 506
         )
506 507
         return Response(response_rss, mimetype='text/xml')
507 508
 
@@ -722,7 +723,8 @@ def opensearch():
722 723
     ret = render('opensearch.xml',
723 724
                  opensearch_method=method,
724 725
                  host=get_base_url(),
725
-                 urljoin=urljoin)
726
+                 urljoin=urljoin,
727
+                 override_theme='__common__')
726 728
 
727 729
     resp = Response(response=ret,
728 730
                     status=200,

+ 2
- 0
tests/unit/test_webapp.py 查看文件

@@ -46,6 +46,8 @@ class ViewsTestCase(SearxTestCase):
46 46
         Search.search = search_mock
47 47
 
48 48
         def get_current_theme_name_mock(override=None):
49
+            if override:
50
+                return override
49 51
             return 'legacy'
50 52
 
51 53
         webapp.get_current_theme_name = get_current_theme_name_mock