Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在我的RSS提要中提供图像缩略图_Html_Xml_Rss - Fatal编程技术网

Html 在我的RSS提要中提供图像缩略图

Html 在我的RSS提要中提供图像缩略图,html,xml,rss,Html,Xml,Rss,我希望我的RSS提要中的图像能够显示出来,这样,如果该提要被带入Facebook,我的页面就会显示带有它的图像 这是我的RSS源: <item> <title>Title</title> <link>www.website.com</link> <guid>www.website.com/1/</guid> <description>Description</description> &l

我希望我的RSS提要中的图像能够显示出来,这样,如果该提要被带入Facebook,我的页面就会显示带有它的图像

这是我的RSS源:

<item>
<title>Title</title>
<link>www.website.com</link>
<guid>www.website.com/1/</guid>
<description>Description</description>
</item>

标题
www.website.com
www.website.com/1/
描述
我是否要添加
,然后将URL插入?或者我应该使用

我不希望图像成为主要内容,而是将其显示为缩略图预览,就像在Facebook上共享网页一样。


<image> 
              <title>Hello World</title> 
              <url>imageurl.gif</url> 
              <link>http://sitelink</link> 
 </image>
你好,世界 imageurl.gif http://sitelink

希望这能有所帮助。

要在RSS中包含图像,您有两个选项来标记该项目

  • img
    标记转换为转义HTML实体:

     <description>&lt;img src="http://example.com/path/to/image"&gt;</description>
    
    img src=”http://example.com/path/to/image"
    
  • 将描述内容包装在CDATA节中:

     <description><![CDATA[<img src="http://example.com/path/to/image">]]></description>
    
    
    
  • 如果您正在考虑使用
    字段,那么它更适合显示
    中包含的对象的名称

    此元素允许您发布图像或视频的缩略图。对于支持媒体RSS的读者来说,这是一项关键功能,因为如果你的媒体内容有一个漂亮闪亮的缩略图,读者更有可能点击它。您肯定需要给出缩略图的URL属性,这是包含缩略图所需要做的全部工作

    -Webmonkey

    使用
    标记

    e、 g:

    
    

    请参阅w3c文档:

    因此,如果RSS提要被带到我的页面上的FB中,它将显示带有它的图像。这是一个描述你们觉得我发现了什么?应该包括指向另一个媒体文件的缩略图的链接,而不是媒体本身。但是如果你觉得它对你的目的有用,它可能会对你有用。那我不想让图像成为主要内容,我希望内容有一个图像,就像在facebook上一样,它会显示缩略图作为图像。我可以在我的描述中有一个iamge和描述吗?你的描述可以有通常在网页上看到的各种HTML。有些读者可能不会解析视频嵌入之类的东西,尽管@Son这不是W3C网站。
    <enclosure 
      url="https://my.domain.tld/images/my_picture.jpg" 
      type="image/jpeg" 
      length="1967"
    />