Commit bc8261c5 authored by Nicolas Gelot's avatar Nicolas Gelot Committed by Romain Hunault

Fix searx version

Searx version is useful for external report tool like stats.searx.xyz.
Then is better for spot project to track the upstream tag to avoid conflict
during the next rebase. The new spot tag format is the folowing:
`<last searx tag>+<spot tag>`. I suggest to use the spot tag with the date format
`YYYYMMDD`. A full tag should be `v0.15.0+20190719`.

Ref: #36
parent 6267e0cc
......@@ -89,7 +89,7 @@
<small>
e Foundation 2018-2019,
{{ _('Powered by') }} <a href="https://gitlab.e.foundation/e/cloud/my-spot">Spot</a>
{{ searx_version }}.<br/>An open-source metasearch engine forked from <a href="https://asciimoo.github.io/searx/">Searx</a>.
{{ metadata_version }}.<br/>An open-source metasearch engine forked from <a href="https://asciimoo.github.io/searx/">Searx</a> {{ searx_version }}.
<span class="links">
<a href="https://e.foundation">{{ _('About') }}</a>
<a href="https://e.foundation/privacy-policy">{{ _('Privacy') }}</a>
......
......@@ -22,3 +22,9 @@ try:
VERSION_STRING = get_distribution("searx").version
except DistributionNotFound:
VERSION_STRING = "0.0.0"
try:
SEARX_VERSION, METADATA_VERSION = VERSION_STRING.split("+")
except ValueError:
SEARX_VERSION = VERSION_STRING
METADATA_VERSION = ""
......@@ -52,7 +52,7 @@ from searx.utils import (
get_static_files, get_result_templates, get_themes, gen_useragent,
dict_subset, prettify_url, match_language
)
from searx.version import VERSION_STRING
from searx.version import VERSION_STRING, SEARX_VERSION, METADATA_VERSION
from searx.languages import language_codes as languages
from searx.search import Search
from searx.search_database import RedisCache
......@@ -333,7 +333,8 @@ def render(template_name, override_theme=None, **kwargs):
if locale in rtl_locales and 'rtl' not in kwargs:
kwargs['rtl'] = True
kwargs['searx_version'] = VERSION_STRING
kwargs['searx_version'] = SEARX_VERSION
kwargs['metadata_version'] = METADATA_VERSION
kwargs['method'] = request.preferences.get_value('method')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment