commit
85269e2af8
8 changed files with 137 additions and 0 deletions
@ -0,0 +1,6 @@ |
||||
{% extends "sost/base.html" %} |
||||
{% block content %} |
||||
<div> |
||||
<h1>Page not found</h1> |
||||
</div> |
||||
{% endblock %} |
@ -0,0 +1,21 @@ |
||||
sost - shokara's own searx theme |
||||
================================ |
||||
Default searx theme used by my searx instance[0]. |
||||
|
||||
Why not default? |
||||
---------------- |
||||
I found the default template to be somewhat bloated and clunky, especially on |
||||
browsers like lynx and links (latter is my main). I also really liked |
||||
Little Isle's layout and found out that it's just a template over a searx |
||||
instance from its admin (Baobab). So, this is made in an effort to create |
||||
something even nicer. |
||||
|
||||
Usage |
||||
----- |
||||
Symlink (or copy the contents) this directory to your searx's templates |
||||
directory. |
||||
|
||||
On FreeBSD, this would be something like: |
||||
ln -s $PWD /usr/local/lib/python3.8/site-packages/searx/templates/sost |
||||
|
||||
[0]: https://s.13f0.net/ |
@ -0,0 +1,18 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd" xml:lang="en"> |
||||
<head> |
||||
<meta content="utf-8" http-equiv="encoding" /> |
||||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" /> |
||||
<title>{% block title %}{% endblock %}{{ instance_name }}</title> |
||||
<link rel="stylesheet" href="./style.css" type="text/css" /> |
||||
|
||||
<link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/> |
||||
</head> |
||||
|
||||
<body> |
||||
{% block content %} |
||||
{% endblock %} |
||||
</body> |
||||
</html> |
@ -0,0 +1,4 @@ |
||||
{% extends "sost/base.html" %} |
||||
{% block content %} |
||||
{% include 'sost/search.html' %} |
||||
{% endblock %} |
@ -0,0 +1,42 @@ |
||||
<!-- Draw glyphicon icon from bootstrap-theme --> |
||||
{% macro icon(action, alt) -%} |
||||
<span title="{{ alt }}"></span> |
||||
{%- endmacro %} |
||||
|
||||
<!-- Draw favicon --> |
||||
{% macro draw_favicon(favicon) -%} |
||||
<img width="32" height="32" class="favicon" src="{{ url_for('static', filename='themes/sost/img/icons/' + favicon + '.png') }}" alt="{{ favicon }}" /> |
||||
{%- endmacro %} |
||||
|
||||
{%- macro result_link(url, title) -%} |
||||
<a href="{{ url }}">{{ title }}</a> |
||||
{%- endmacro -%} |
||||
|
||||
<!-- Draw result header --> |
||||
{% macro result_header(result) -%} |
||||
<h3>{% if result.url %}{{ result_link(result.url, result.title|safe) }}{% else %}{{ result.title|safe}}{% endif %}</h3> |
||||
<p>{{ result.url }}</p> |
||||
{%- endmacro %} |
||||
|
||||
<!-- Draw result sub header --> |
||||
{% macro result_sub_header(result, id) -%} |
||||
{%- if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif -%} |
||||
{%- if result.magnetlink %}<small> • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink", id) }}</small>{% endif -%} |
||||
{%- if result.torrentfile %}<small> • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile", id) }}</small>{% endif -%} |
||||
{%- endmacro %} |
||||
|
||||
<!-- Draw result footer --> |
||||
{% macro result_footer(result) -%} |
||||
<div> |
||||
{%- if result.url -%} |
||||
{%- if result.cached_url -%} |
||||
<small>{{ result_link(result.cached_url, icon('link') + _('cached')) }}</small> |
||||
{%- elif not result.is_onion -%} |
||||
<small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached')) }}</small> |
||||
{%- endif -%} |
||||
{%- endif -%} |
||||
</div> |
||||
{%- if result.pretty_url -%} |
||||
<div class="external-link">{{ result.pretty_url }}</div> |
||||
{%- endif -%} |
||||
{%- endmacro %} |
@ -0,0 +1,6 @@ |
||||
{% from 'sost/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context %} |
||||
|
||||
{{- result_header(result) -}} |
||||
{{- result_sub_header(result) -}} |
||||
|
||||
{%- if result.content %}<p>{{ result.content|safe }}</p>{% endif -%} |
@ -0,0 +1,34 @@ |
||||
{% extends "sost/base.html" %} |
||||
|
||||
{% macro search_form_attrs(pageno) -%} |
||||
<input type="hidden" name="q" value="{{ q|e }}" /> |
||||
<input type="hidden" name="pageno" value="{{ pageno }}" /> |
||||
{%- endmacro %} |
||||
|
||||
{% block title %}{{ q|e }} - {% endblock %} |
||||
{% block content %} |
||||
<a href="/">Home</a> |
||||
{% include 'sost/search.html' %} |
||||
|
||||
<div id="main_results"> |
||||
{% for result in results -%} |
||||
<div> |
||||
{%- set index = loop.index -%} |
||||
{% include 'sost/result_templates/default.html' %} |
||||
</div> |
||||
{% endfor %} |
||||
|
||||
{% if paging -%} |
||||
{% if pageno != 1 %} |
||||
<form method="get" action="/"> |
||||
{{- search_form_attrs(pageno-1) -}} |
||||
<button type="submit">previous page<button> |
||||
</form> |
||||
{% endif %} |
||||
<form method="get" action="/"> |
||||
{{- search_form_attrs(pageno+1) -}} |
||||
<button type="submit">next page</button> |
||||
</form> |
||||
{% endif %} |
||||
</div> |
||||
{% endblock %} |
@ -0,0 +1,6 @@ |
||||
<div> |
||||
<form method="get" action="/"> |
||||
<input type="text" name="q" size="45" /> |
||||
<input type="submit" value="search" /> |
||||
</form> |
||||
</div> |
Loading…
Reference in new issue