mirror of
https://github.com/searxng/searxng.git
synced 2026-05-26 21:00:13 +02:00
[mod] typification of SearXNG: add new result type Image (#6142)
- Python class: searx/result_types/image.py - Jinja template: searx/templates/simple/result_templates/images.html - CSS (less) client/simple/src/less/result_types/image.less Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
committed by
Markus Heiser
parent
28ef4f7447
commit
c629dd4f3c
@@ -0,0 +1,7 @@
|
||||
.. _result_types.image:
|
||||
|
||||
=============
|
||||
Image Results
|
||||
=============
|
||||
|
||||
.. automodule:: searx.result_types.image
|
||||
@@ -1,4 +1,8 @@
|
||||
.. _result_types.mainresult:
|
||||
|
||||
============
|
||||
Main Results
|
||||
============
|
||||
|
||||
.. autoclass:: searx.result_types._base.MainResult
|
||||
:members:
|
||||
|
||||
@@ -18,13 +18,13 @@ following types have been implemented so far ..
|
||||
main/code
|
||||
main/paper
|
||||
main/file
|
||||
main/image
|
||||
|
||||
The :ref:`LegacyResult <LegacyResult>` is used internally for the results that
|
||||
have not yet been typed. The templates can be used as orientation until the
|
||||
final typing is complete.
|
||||
|
||||
- :ref:`template default` / :py:obj:`Result`
|
||||
- :ref:`template images`
|
||||
- :ref:`template videos`
|
||||
- :ref:`template torrent`
|
||||
- :ref:`template map`
|
||||
|
||||
@@ -129,53 +129,6 @@ audio_src : uri,
|
||||
URL of an embedded ``<audio controls>``.
|
||||
|
||||
|
||||
.. _template images:
|
||||
|
||||
``images.html``
|
||||
---------------
|
||||
|
||||
The images are displayed as small thumbnails in the main results list.
|
||||
|
||||
title : :py:class:`str`
|
||||
Title of the image.
|
||||
|
||||
thumbnail_src : :py:class:`str`
|
||||
URL of a preview of the image.
|
||||
|
||||
resolution :py:class:`str`
|
||||
The resolution of the image (e.g. ``1920 x 1080`` pixel)
|
||||
|
||||
|
||||
Image labels
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Clicking on the preview opens a gallery view in which all further metadata for
|
||||
the image is displayed. Addition fields used in the :origin:`images.html
|
||||
<searx/templates/simple/result_templates/images.html>`:
|
||||
|
||||
img_src : :py:class:`str`
|
||||
URL of the full size image.
|
||||
|
||||
content: :py:class:`str`
|
||||
Description of the image.
|
||||
|
||||
author: :py:class:`str`
|
||||
Name of the author of the image.
|
||||
|
||||
img_format : :py:class:`str`
|
||||
The format of the image (e.g. ``png``).
|
||||
|
||||
source : :py:class:`str`
|
||||
Source of the image.
|
||||
|
||||
filesize: :py:class:`str`
|
||||
Size of bytes in :py:obj:`human readable <searx.humanize_bytes>` notation
|
||||
(e.g. ``MB`` for 1024 \* 1024 Bytes filesize).
|
||||
|
||||
url : :py:class:`str`
|
||||
URL of the page from where the images comes from (source).
|
||||
|
||||
|
||||
.. _template videos:
|
||||
|
||||
``videos.html``
|
||||
|
||||
Reference in New Issue
Block a user