Menu
Home
About
Our Role
Goals
The Team
Roadmap
Tokenomics
How To Buy
Knowledge Base
Contacts
Sitemap & Links
A.I.
Chart
Shop
IMMORTALITY
🏠
⬇️
Searxng Frequent Sites
New name
B
I
U
S
link
image
code
HTML
list
Show page
Syntax
templates/simple/index.html {pre} {% extends "simple/base.html" %} {% from 'simple/icons.html' import icon_big %} {% block content %} <div class="index"> <div class="title"><h1>SearXNG</h1></div> {% include 'simple/simple_search.html' %} {% if most_visited_sites %} <div class="top-sites"> <div class="site-grid" style="margin-top: 33px; max-width: 60%; margin-left: auto; margin-right: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 5px;"> {% for site in most_visited_sites %} <a href="{{ site.url }}" class="site-tile"> <img src="{{ site.favicon }}" alt="{{ site.title }} favicon" width="32"> </a> {% endfor %} </div> </div> {% endif %} </div> {% endblock %} {/pre} /searx/preferences.py:482 {pre} self.key_value_settings['custom_text'] = StringSetting( '', locked=is_locked('custom_text') ) {/pre} /templates/simple/preferences.html {pre} {{- tab_header('maintab', 'quicklinks', _('Quick Links')) -}} {%- include 'simple/preferences/quicklinks.html' -%} {{- tab_footer() -}} {/pre} /searx/webapp.py {pre} def get_most_visited_sites(request, limit=50): sites = [] custom_text = request.preferences.get_value('custom_text') print(f"Cookie value: {custom_text}") # Debugging: check the cookie value if custom_text: # Split the cookie value by newlines instead of commas for entry in custom_text.splitlines(): parts = entry.strip().split('|') if len(parts) == 3: sites.append({ "url": parts[0], "title": parts[1], "favicon": parts[2] }) print(f"Parsed sites: {sites}") # Debugging: check the parsed list return sites[:limit] {/pre} /searx/webapp.py {pre} @app.route('/', methods=['GET', 'POST']) def index(): """Render index page.""" # redirect to search if there's a query in the request if request.form.get('q'): query = ('?' + request.query_string.decode()) if request.query_string else '' return redirect(url_for('search') + query, 308) most_visited_sites = get_most_visited_sites(request, limit=50) return render( # fmt: off 'index.html', selected_categories=get_selected_categories(request.preferences, request.form), current_locale = request.preferences.get_value("locale"), most_visited_sites=most_visited_sites # fmt: on ) {/pre} /searx/webapp.py:404 {pre} kwargs['custom_text'] = request.preferences.get_value('custom_text') {/pre} /searx/preferences.py:478 {pre} self.key_value_settings['custom_text'] = StringSetting( '', locked=is_locked('custom_text') ) {/pre}
Password
Summary of changes
📜
⏱️
⬆️