@@ -2,14 +2,10 @@
22
33import sys, os
44from sphinx_build_tools import load_sphinx_config
5−from searx.version import VERSION_STRING
65from pallets_sphinx_themes import ProjectLink
76
8−from searx.brand import GIT_URL
9−GIT_BRANCH = os.environ.get("GIT_BRANCH", "master")
10−from searx.brand import SEARX_URL
11−from searx.brand import DOCS_URL
12−
7+from searx import brand
8+from searx.version import VERSION_STRING
139
1410# Project --------------------------------------------------------------
1511
@@ -46,10 +42,10 @@ extlinks['wiki'] = ('https://github.com/searx/searx/wiki/%s', ' ')
4642extlinks['pull'] = ('https://github.com/searx/searx/pull/%s', 'PR ')
4743
4844# links to custom brand
49−extlinks['origin'] = (GIT_URL + '/blob/' + GIT_BRANCH + '/%s', 'git://')
50−extlinks['patch'] = (GIT_URL + '/commit/%s', '#')
51−extlinks['search'] = (SEARX_URL + '/%s', '#')
52−extlinks['docs'] = (DOCS_URL + '/%s', 'docs: ')
45+extlinks['origin'] = (brand.GIT_URL + '/blob/' + brand.GIT_BRANCH + '/%s', 'git://')
46+extlinks['patch'] = (brand.GIT_URL + '/commit/%s', '#')
47+extlinks['search'] = (brand.SEARX_URL + '/%s', '#')
48+extlinks['docs'] = (brand.DOCS_URL + '/%s', 'docs: ')
5349extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ')
5450extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '')
5551#extlinks['role'] = (
@@ -104,14 +100,20 @@ imgmath_font_size = 14
104100# sphinx.ext.imgmath setup END
105101
106102html_theme_options = {"index_sidebar_logo": True}
107−html_context = {
108− "project_links": [
109− ProjectLink("Source", GIT_URL),
110− ProjectLink("Wiki", "https://github.com/searx/searx/wiki"),
111− ProjectLink("Public instances", "https://searx.space/"),
112− ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
113− ]
114−}
103+html_context = {"project_links": [] }
104+if brand.GIT_URL:
105+ html_context["project_links"].append(ProjectLink("Source", brand.GIT_URL))
106+if brand.WIKI_URL:
107+ html_context["project_links"].append(ProjectLink("Wiki", brand.WIKI_URL))
108+if brand.PUBLIC_INSTANCES:
109+ html_context["project_links"].append(ProjectLink("Public instances", brand.PUBLIC_INSTANCES))
110+if brand.TWITTER_URL:
111+ html_context["project_links"].append(ProjectLink("Twitter", brand.TWITTER_URL))
112+if brand.ISSUE_URL:
113+ html_context["project_links"].append(ProjectLink("Issue Tracker", brand.ISSUE_URL))
114+if brand.CONTACT_URL:
115+ html_context["project_links"].append(ProjectLink("Contact", brand.CONTACT_URL))
116+
115117html_sidebars = {
116118 "**": ["project.html", "relations.html", "searchbox.html"],
117119}