我正在使用discord,我看到很多人都这样做(图中的大方块)。 我尝试在带有元标记的 html 中执行此操作,但结果是(图像编号 2)。 我真的很想知道该怎么做,有人可以帮助我吗?
这是我用来执行此操作的代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta property="og:title" content="An Image By ItsJustOne#9817">
<meta property="og:description" content="Remember always that there is an end in the tunnel 🥰">
<meta property="og:image" content="https://cdn.discordapp.com/banners/907132383814377502/4aca154cd6040b31aacaaf781877f121.png?size=1024">
<meta name="viewport" content="width=device-width">
<title>Why You Are Here?</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
Why You Are Here?
<script src="script.js"></script>
</body>
</html>
我尝试使用的图像是我的不和谐横幅。
已经是4个月前了,我忘了写在这里,我在这里询问一周后找到了解决方案!
解决方案很简单,使用其他元标记,而不是常规的。 Twitter 元标签。
<meta name="twitter:title" content="Title">
<meta name="twitter:description" content="Cool description">
<meta name="twitter:image" content="the image link">
<meta name="twitter:card" content="summary_large_image">
替换标题、描述和图像链接。
我发现了一个很好的工具,可以让你实时可视化它的样子,并为你生成相应的元标签。多个社交媒体。
Facebook 就是这样
<head>
<title> the tools are https://metatags.io/ </title>
<!-- Open graph / facebook --->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://some-url" />
<meta property="og:title" content="title to display" />
<meta property="og:description" content="description to display" />
<meta property="og:image" content="https://some-image.png" />
</head>