我在Telegram中看到了很多或者有关丰富的链接预览的请求,但这是关于“如何在预览中获得大/大图像”。
我们以我网站上的this article为例。它已经拥有所有OG:
<meta property="og:title" content="Questa settimana su TLI (08 dicembre 2018)" />
<meta property="og:type" content="article" />
<meta property="og:image" content="https://turbolab.it/immagini/12483/max" />
<meta property="og:url" content="https://turbolab.it/newsletter-turbolab.it-1349/questa-settimana-tli-08-dicembre-2018-1812" />
<meta property="og:description" content="Non hai tempo di leggerci tutti i giorni? nessun problema! ecco a te il riepilogo di quanto proposto da TurboLab.it nel corso della settimana in conclusione." />
<meta property="og:locale" content="it_IT" />
<meta property="og:site_name" content="turbolab.it" />
结果:链接在Telegram上发布时可以正常工作,但即使og:image(this)宽度为1000 px,图像也很小并且向右浮动。我想在它自己的路线上拥有它。
检查一下(第一个条目是我的网站,我要修复的网站:请注意小图片,向右浮动。第二个和第三个是我想要的结果,如YouTube视频和Mashable文章所示)。
上图中使用的3个URL是:
richpreview.com没有帮助,因为它在所有theree(one,two,three)上预览图像为“small”。
奇怪的是:它在Facebook上按预期工作。 There,我得到了大而宽的图像。它也是完美的on Twitter。
我错过了什么?
我错过了什么?
为了获得有关Telegram的最佳体验,您应该创建一个Telegram Instant View。
示例即时视图模板:
# enable for items in the post section
?path: /post/.+
# define required elements
title: //*[@itemprop="headline"]
body: //*[@itemprop="articleBody"]
# if cover exists, define images
?exists: //head/meta[@property="og:image"]/@content
cover: //head/meta[@property="og:image"]/@content
image_url: $cover/self::img/@src
用于允许从即时视图加入频道的元标记示例:
<meta property="telegram_channel" content="turbolabit">
您可能会失去对访问者指标的一些可见性,但您的用户将有更好的体验,从Telegram中阅读和享受您的网站,并会导致更多的重复访问者。
添加twitter元标记为我解决了这个问题
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="{IMAGE URL}" />