Timur
Timur

Reputation: 211

How to get link card using meta

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]

enter image description here

How can I do that?

I just have found this sample:

<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">

Upvotes: 0

Views: 739

Answers (2)

user2226755
user2226755

Reputation: 13173

You can try your code with : https://cards-dev.twitter.com/validator

<head>
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://stackoverflow.com/questions/54984552/how-to-get-link-to-source-using-htm-css">
    <meta property="og:site_name" content="Stack Overflow">
    <meta property="og:image" itemprop="image primaryImageOfPage" content="https://cdn.sstatic.net/Sites/stackoverflow/img/[email protected]?v=73d79a89bded">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:domain" content="stackoverflow.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...">

enter image description here

Upvotes: 0

You have to add some meta tags.

<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" />

Upvotes: 2

Related Questions