From 937165853185ca16b0da6f72bc42bd1487ea0dcb Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 13 Oct 2025 09:28:42 +0200 Subject: [mod] typification of SearXNG: add new result type File This PR adds a new result type: File Python class: searx/result_types/file.py Jinja template: searx/templates/simple/result_templates/file.html CSS (less) client/simple/src/less/result_types/file.less Class 'File' (singular) replaces template 'files.html' (plural). The renaming was carried out because there is only one file (singular) in a result. Not to be confused with the category 'files' where in multiple results can exist. As mentioned in issue [1], the class '.category-files' was removed from the CSS and the stylesheet was adopted in result_types/file.less (there based on the templates and no longer based on the category). [1] https://github.com/searxng/searxng/issues/5198 Signed-off-by: Markus Heiser --- docs/dev/templates.rst | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'docs/dev/templates.rst') diff --git a/docs/dev/templates.rst b/docs/dev/templates.rst index e2fa879c8..1995dac48 100644 --- a/docs/dev/templates.rst +++ b/docs/dev/templates.rst @@ -60,7 +60,7 @@ Fields used in the template :origin:`macro result_sub_header publishedDate : :py:obj:`datetime.datetime` The date on which the object was published. -length: :py:obj:`time.struct_time` +length: :py:obj:`datetime.timedelta` Playing duration in seconds. views: :py:class:`str` @@ -469,38 +469,6 @@ links : :py:class:`dict` Additional links in the form of ``{'link_name': 'http://example.com'}`` -.. _template files: - -``files.html`` --------------- - -Displays result fields from: - -- :ref:`macro result_header` and -- :ref:`macro result_sub_header` - -Additional fields used in the :origin:`code.html -`: - -filename, size, time: :py:class:`str` - Filename, Filesize and Date of the file. - -mtype : ``audio`` | ``video`` | :py:class:`str` - Mimetype type of the file. - -subtype : :py:class:`str` - Mimetype / subtype of the file. - -abstract : :py:class:`str` - Abstract of the file. - -author : :py:class:`str` - Name of the author of the file - -embedded : :py:class:`str` - URL of an embedded media type (``audio`` or ``video``) / is collapsible. - - .. _template products: ``products.html`` -- cgit v1.2.3