如何使用 meta 获取 link 卡片

How to get link card using meta

我有一个包含几页的网站,例如,如果我想与某人分享我的 link 之一并通过 whatsapp 发送,我需要在消息中看到徽标和一些文本。 [如图所示]

我该怎么做?

我刚找到这个样本:

<link rel="shortcut icon" href="img/img.svg">
<link rel="apple-touch-icon image_src" href="img/img.svg">
<meta name="twitter:title" property="og:title" itemprop="name" content="Link to source">
<meta name="twitter:description" property="og:description" itemprop="description" content="Mycontent">

您必须添加一些元标记。

<meta property="og:site_name" content="Your site name">
<meta property="og:title" content="Page title" />
<meta property="og:description" content="Page description" />
<meta property="og:image" itemprop="image" content="your_page_image.png">
<meta property="og:type" content="website" />

您可以尝试您的代码:https://cards-dev.twitter.com/validator

<head>
    <meta property="og:type" content="website">
    <meta property="og:url" content="">
    <meta property="og:site_name" content="Stack Overflow">
    <meta property="og:image" itemprop="image primaryImageOfPage" content="https://cdn.sstatic.net/Sites/Whosebug/img/apple-touch-icon@2.png?v=73d79a89bded">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:domain" content="whosebug.com">
    <meta name="twitter:title" property="og:title" itemprop="name" content="How to get link to source using htm css">
    <meta name="twitter:description" property="og:description" itemprop="description" content="I have a web site with a few pages and for example if I want to share with somebody one of my link and send it via whatsapp, I need to see logo and some text in my message. [as it on this image] H...">