From 3198c906af6a552b6871e0948659bbf89fae08ed Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 24 Sep 2022 14:19:51 +0200 Subject: [PATCH] [mod] paper.html: add links to doi resolver Signed-off-by: Markus Heiser --- searx/templates/simple/result_templates/paper.html | 4 ++-- searx/webapp.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/searx/templates/simple/result_templates/paper.html b/searx/templates/simple/result_templates/paper.html index 54704c866..2c9717edd 100644 --- a/searx/templates/simple/result_templates/paper.html +++ b/searx/templates/simple/result_templates/paper.html @@ -1,4 +1,4 @@ -{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} +{% 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) -}}
@@ -23,7 +23,7 @@ {%- 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.doi -}}
{% 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 -%}
diff --git a/searx/webapp.py b/searx/webapp.py index 44500911a..ab24a7253 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -466,6 +466,7 @@ def render(template_name: str, **kwargs): kwargs['proxify_results'] = settings['result_proxy']['proxify_results'] kwargs['cache_url'] = settings['ui']['cache_url'] kwargs['get_result_template'] = get_result_template + kwargs['doi_resolver'] = get_doi_resolver(request.preferences) kwargs['opensearch_url'] = ( url_for('opensearch') + '?'