本文介绍了具有说明和图像的URL的元标记(在Skype中,不和谐)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


当有人在Skype或Discord中发送链接时,它可以创建图像和描述,如屏幕截图所示:


When somone send link in Skype or Discord, it can create image and description, like is shown on screenshots:

我认为这是因为HTML <head>中的<meta>标记.但是在HTML中可能是<meta>标记的不雅之物. //gist.github.com/lancejpollard/1978404 这就是很多标签.是否有人只知道标签,这些标签会在Skype和Discord上制作这些图像和说明?

I think its because of <meta> tags in HTML <head>.But in HTML can be hunderts of <meta> tags.. I found this page on GitHub, Link: https://gist.github.com/lancejpollard/1978404And that's so many tags. Is there someone who know only tags, which is making these images and descriptions on Skype and Discord?

我尝试添加一些元标记,网站图标和标题,但是它不起作用,我不知道我需要哪个<meta>标签.

I tried adding some meta tags, favicon, and title, but it not works, I don't know which <meta> tags I need.

我尝试的代码:

<title>Weird Website</title>
<meta name="description" content="Ehm.. weird website"/>
<meta name="url" content="http://www.weirdwebsite.idk/">
<link rel="icon" href="favicon.ico" type="image/x-icon" />

它看起来像这样:


(Skype正在拍摄<title>,但是图像在哪里?)

And..discord仅显示基本链接.谁知道在发送链接后如何自动添加图像和一些文本?(仅举例来说,btw zzz.com不是我的网站)
谢谢,
奥利弗.


(Skype is taking <title> but where is an image?)

And.. discord shows only basic link.Who knows how to automatically add image and some text when is sent a link?(btw zzz.com isn't my website, only for example)
Thanks,
Oliver.

推荐答案

<meta property="og:title" content="Site Title" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://my.site.com" />
<meta property="og:image" content="http://my.site.com/images/thumb.png" />
<meta property="og:description" content="Site description" />

在Skype上显示为链接预览的图像是og:image中指定的拇指图像(页面上其他任何地方均不可用).

And the image displayed as the link preview on Skype is the thumb image specified in og:image (that is not available anywhere else on the page).

请记住,Skype可能还会缓存信息.

Keep in mind that Skype may also cache information.

这篇关于具有说明和图像的URL的元标记(在Skype中,不和谐)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 23:16