diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2024-10-29 15:09:40 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-11-25 09:34:02 +0100 |
commit | 5fbea0b62df9877b4c07489ca631ced7af0d939b (patch) | |
tree | 7a24fc678b500ce153246f5dc6f08832c6c4693f | |
parent | eb59b4604a6c9de2ac6943d07a2a09a06e7e279a (diff) | |
download | searxng-5fbea0b62df9877b4c07489ca631ced7af0d939b.tar.gz searxng-5fbea0b62df9877b4c07489ca631ced7af0d939b.zip |
[refactor] <type> element isn't a part of the RSS 2.0 spec [1]
[1] https://cyber.harvard.edu/rss/rss.html
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
-rw-r--r-- | searx/static/themes/simple/xsl/rss.xsl | 86 | ||||
-rw-r--r-- | searx/templates/simple/opensearch_response_rss.xml | 25 | ||||
-rwxr-xr-x | searx/webapp.py | 3 |
3 files changed, 34 insertions, 80 deletions
diff --git a/searx/static/themes/simple/xsl/rss.xsl b/searx/static/themes/simple/xsl/rss.xsl index a8d9225f5..7de7f8037 100644 --- a/searx/static/themes/simple/xsl/rss.xsl +++ b/searx/static/themes/simple/xsl/rss.xsl @@ -1,59 +1,39 @@ <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - <xsl:output method="html" version="5" encoding="UTF-8" indent="yes" /> - <xsl:template match="rss"> - <html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title><xsl:value-of select="channel/title" /> RSS Feed</title> - <meta charset="UTF-8" /> - <meta http-equiv="x-ua-compatible" content="IE=edge,chrome=1" /> - <meta name="viewport" content="width=device-width,initial-scale=1" /> - <style type="text/css"> - html { - background: #fff; - color: #444; - } - - a { - color: #334999; - text-decoration: none; - } - - a:hover { - text-decoration: underline; - } - </style> - </head> - <body> - <header> - <h2> - <xsl:value-of select="channel/description" /> - </h2> - </header> - <hr /> - <main> - <xsl:for-each select="channel/item"> - <article> - <h3> - <a hreflang="en" target="_blank"> - <xsl:attribute name="href"> - <xsl:value-of select="link" /> - </xsl:attribute> - <xsl:value-of select="title" /> - </a> - </h3> - <time> - <xsl:value-of select="pubDate" /> - </time> - <p><xsl:value-of select="description" /></p> - <hr /> - </article> - </xsl:for-each> - </main> - </body> - </html> + <html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title><xsl:value-of select="channel/title" />RSS Feed</title> + <meta charset="UTF-8" /> + <meta http-equiv="x-ua-compatible" content="IE=edge,chrome=1" /> + <meta name="viewport" content="width=device-width,initial-scale=1" /> + </head> + <body> + <header> + <h2> + <xsl:value-of select="channel/description" /> + </h2> + </header> + <hr /> + <main> + <xsl:for-each select="channel/item"> + <article> + <h3> + <a hreflang="en" target="_blank"> + <xsl:attribute name="href"> + <xsl:value-of select="link" /> + </xsl:attribute> + <xsl:value-of select="title" /> + </a> + </h3> + <time><xsl:value-of select="pubDate" /></time> + <p><xsl:value-of select="description" /></p> + <hr /> + </article> + </xsl:for-each> + </main> + </body> + </html> </xsl:template> - </xsl:stylesheet> diff --git a/searx/templates/simple/opensearch_response_rss.xml b/searx/templates/simple/opensearch_response_rss.xml index b827bae85..574f32e69 100644 --- a/searx/templates/simple/opensearch_response_rss.xml +++ b/searx/templates/simple/opensearch_response_rss.xml @@ -21,34 +21,11 @@ {% for r in results %} <item> <title>{{ r.title }}</title> + <type>result</type> <link>{{ r.url }}</link> <description>{{ r.content }}</description> {% if r.pubdate %}<pubDate>{{ r.pubdate }}</pubDate>{% endif %} </item> {% endfor %} - {% if answers %} - {% for a in answers %} - <item> - <title>{{ a }}</title> - <type>answer</type> - </item> - {% endfor %} - {% endif %} - {% if corrections %} - {% for a in corrections %} - <item> - <title>{{ a }}</title> - <type>correction</type> - </item> - {% endfor %} - {% endif %} - {% if suggestions %} - {% for a in suggestions %} - <item> - <title>{{ a }}</title> - <type>suggestion</type> - </item> - {% endfor %} - {% endif %} </channel> </rss> diff --git a/searx/webapp.py b/searx/webapp.py index 1c0158382..8158256e6 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -731,9 +731,6 @@ def search(): response_rss = render( 'opensearch_response_rss.xml', results=results, - answers=result_container.answers, - corrections=result_container.corrections, - suggestions=result_container.suggestions, q=request.form['q'], number_of_results=result_container.number_of_results, ) |