How to exclude Jumbotron image from thumbnails from social networks?

Whenever my blog post is split, the thumbnail automatically creates a jumbotron image, not the default for the blog image:

enter image description here

enter image description here

view

<%= image_tag "galli-walking.jpg", alt: "Conquering life and goal challenges so we can get the most out of life.", class: "main-image" %>
<div class="blog-text">
  <div class="blog-paragraph">
    A DAILY BLOG ABOUT MY<br>
    JOURNEY & LIFESTYLE
  </div>
  <%= render 'subscribes/subscribe.html.erb' %>
</div>
<%= link_to @post.title, blog_path(@post) %>
<%= simple_format(@post.body, {}, {:sanitize => false}) %>
+4
source share
4 answers

Try adding this tag to <head></head>

<meta property="og:image" content="<%= image_path('your_image') %>" />

A possible solution to exclude the image from general use is to use the div property with CSS. Instead of this

<%= image_tag "galli-walking.jpg", alt: "Conquering life and goal challenges so we can get the most out of life.", class: "main-image" %>

using

<div style="background-image: url('galli-walking.jpg'); width:Xpx; height:Xpx;></div>
+3
source

Read more of these articles. All you need to do is dynamically generate the Facebook Open Graph meta tag.

<meta property="og:image" content="http://static01.nyt.com/images/2015/02/19/arts/international/19iht-btnumbers19A/19iht-btnumbers19A-facebookJumbo-v2.jpg" />

https://blog.kissmetrics.com/open-graph-meta-tags/

https://developers.facebook.com/docs/sharing/webmasters

Facebook Open Graph

+2

(Warning: Untested , ;)

robots.txt :

User-agent: *
Disallow: /Path/to/galli-walking.jpg
+1

- , Facebook, Twitter .., head , , ​​ , , .. :

<meta property="og:title" content="<%= title %>">
<meta property="og:description" content="<%= description %>">
<meta property="og:image" content="<%= image_url %>">
<meta property="og:image:width" content="<%= width %>">
<meta property="og:image:height" content="<%= height %>">

, .

og =

Learn more about this here .

Hope this helps.

+1
source

All Articles