mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
parent
a13d8955bf
commit
e629c9ccc4
3 changed files with 32 additions and 4 deletions
|
@ -69,7 +69,7 @@ jinja_filters = {
|
|||
|
||||
def process_link(href):
|
||||
if href.startswith('/'):
|
||||
return '../go-to-instance.html'
|
||||
return '../go-to-instance.html#' + href
|
||||
else:
|
||||
return href
|
||||
|
||||
|
|
21
docs/go-to-instance.html
Normal file
21
docs/go-to-instance.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<noscript>This requires JavaScript.</noscript>
|
||||
<ul id=links></ul>
|
||||
<script>
|
||||
(async function() {
|
||||
const links = document.getElementById('links');
|
||||
let res = await fetch('https://searx.space/data/instances.json');
|
||||
let instances = await res.json();
|
||||
for (const [url, info] of Object.entries(instances.instances)) {
|
||||
if (info.error)
|
||||
continue;
|
||||
if (url.startsWith('https://')) {
|
||||
const li = document.createElement('li');
|
||||
const a = document.createElement('a');
|
||||
a.href = url + location.hash.substr(2);
|
||||
a.textContent = url + location.hash.substr(2);
|
||||
li.appendChild(a);
|
||||
links.appendChild(li);
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
|
@ -1,7 +1,14 @@
|
|||
:orphan:
|
||||
|
||||
=======================
|
||||
We cannot link there :(
|
||||
=======================
|
||||
=================
|
||||
Go to instance...
|
||||
=================
|
||||
|
||||
The link you followed depends on the instance.
|
||||
We don't know which instance you're using.
|
||||
|
||||
For your convenience the instances from
|
||||
`searx.space <https://searx.space/>`_ are linked below:
|
||||
|
||||
.. raw:: html
|
||||
:file: go-to-instance.html
|
||||
|
|
Loading…
Add table
Reference in a new issue