From 7eedd44f5f9965cf2fbff14d276f96944b5c6a98 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 10 Sep 2025 16:10:42 +0200 Subject: [mod] typification of SearXNG: add new result type Paper This patch adds a new result type: Paper - Python class: searx/result_types/paper.py - Jinja template: searx/templates/simple/result_templates/paper.html - CSS (less) client/simple/src/less/result_types/paper.less Signed-off-by: Markus Heiser --- searx/templates/simple/result_templates/paper.html | 102 ++++++++++++++++----- 1 file changed, 80 insertions(+), 22 deletions(-) (limited to 'searx/templates') diff --git a/searx/templates/simple/result_templates/paper.html b/searx/templates/simple/result_templates/paper.html index 7e94cf174..074ad9081 100644 --- a/searx/templates/simple/result_templates/paper.html +++ b/searx/templates/simple/result_templates/paper.html @@ -1,34 +1,92 @@ {% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_link with context %} -{{ result_header(result, favicons, image_proxify) -}} +{{ result_header(result, favicons, image_proxify) }} +
- {%- if result.publishedDate %}
{{ _("Published date") }}:
{% endif -%} - {%- if result.authors %}
{{ _("Author") }}:{{ result.authors | join(", ") }}
{% endif -%} + {%- if result.date_of_publication %} +
+ {{ _("Published date") }}: + {{ result.date_of_publication.l10n_date("long", "UI") }} +
+ {% endif -%} + {%- if result.authors %} +
+ {{ _("Author") }}: + {{ result.authors | join(", ") }} +
+ {% endif -%} {%- if result.journal -%} -
- {{- _("Journal") }}:{{ result.journal -}} - {%- if result.volume -%} -  {{- result.volume -}} - {%- if result.number -%} - .{{- result.number -}} +
+ {{- _("Journal") }}: + {{ result.journal -}} + {%- if result.volume -%} +  {{- result.volume -}} + {%- if result.number -%}.{{- result.number -}}{%- endif -%} {%- endif -%} - {%- endif -%} - {%- if result.pages -%} -  {{- result.pages -}} - {%- endif -%} + {%- if result.pages -%} {{- result.pages -}}{%- endif -%}
{%- endif %} - {%- if result.editor %}
{{ _("Editor") }}:{{ result.editor }}
{% endif -%} - {%- if result.publisher %}
{{ _("Publisher") }}:{{ result.publisher }}
{% endif -%} - {%- if result.type %}
{{ _("Type") }}:{{ result.type }}
{% endif -%} - {%- if result.tags %}
{{ _("Tags") }}:{{ result.tags | join(", ")}}
{%- endif -%} - {%- if result.doi %}
{{ _("DOI") }}:{{ result_link(doi_resolver + result.doi, result.doi) }}
{% endif -%} - {%- if result.issn %}
{{ _("ISSN") }}:{{ result.issn | join(", ") }}
{% endif -%} - {%- if result.isbn %}
{{ _("ISBN") }}:{{ result.isbn | join(", ") }}
{% endif -%} + {%- if result.editor %} +
+ {{ _("Editor") }}: + {{ result.editor }} +
+ {% endif -%} + {%- if result.publisher %} +
+ {{ _("Publisher") }}: + {{ result.publisher }} +
+ {% endif -%} + {%- if result.type %} +
+ {{ _("Type") }}: + {{ result.type }} +
+ {% endif -%} + {%- if result.tags %} +
+ {{ _("Tags") }}: + {{ result.tags | join(", ")}} +
+ {%- endif -%} + {%- if result.doi %} +
+ {{ _("DOI") }}: + {{ result_link(doi_resolver + result.doi, result.doi) }} +
+ {% endif -%} + {%- if result.issn %} +
+ {{ _("ISSN") }}: + {{ result.issn | join(", ") }} +
+ {% endif -%} + {%- if result.isbn %} +
+ {{ _("ISBN") }}: + {{ result.isbn | join(", ") }} +
+ {% endif -%} + {%- if result.views %} +
+ {{ _('Views') }}: + {{ result.views }} +
+ {% endif -%}
-{%- if result.content -%}

{{- result.content | safe -}}

{%- endif -%} -{%- if result.comments -%}

{{- result.comments -}}

{%- endif -%} +{%- if result.content -%} +

{{- result.content | safe -}}

+{%- endif -%} +{%- if result.comments -%} +

{{- result.comments -}}

+{%- endif -%} + +{%- if result.metadata %} +
{{ result.metadata|safe }}
+{% endif -%} +