【问题标题】:Twitter card is not being rendered even with meta tags present即使存在元标记,也不会呈现 Twitter 卡
【发布时间】:2016-03-17 16:12:25
【问题描述】:

正在尝试创建推特卡。我在页面标题中有以下元标记。出于某种原因,当我将链接放入我的推文时,推特卡没有被呈现。有什么建议吗?

<!--- og: tags to create nice facebook & twitter posts for an auction --->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@herberzt_dev" />
<meta name="twitter:creator" content="@herberzt_dev" />
<% if !@item.nil? %>
    <meta property="og:title" content="<%= @item.name %>"/>
    <meta property="og:type" content="website"/>
    <meta property="og:url" content="<%= request.original_url %>"/>
    <meta property="og:image" content="<%= @item.photo(:thumbnail) %>"/>
    <meta property="og:description" content="<%= @item.description %>"/>
    <meta name="twitter:site" content="@herberzt_dev">
<% elsif !@auction.nil? %>
    <meta property="og:title" content="<%= @auction.name %>"/>
    <meta property="og:type" content="website"/>
    <meta property="og:url" content="<%= request.original_url %>"/>
    <meta property="og:image" content="<%= @auction.photo %>"/>
    <meta property="og:description" content="<%= @auction.description %>"/>
<% end %>

【问题讨论】:

    标签: html twitter facebook-opengraph twitter-card


    【解决方案1】:

    应该这条线;

    <% elsif !@auction.nil? %> 
    

    是:

    <% elseif !@auction.nil? %>
    

    【讨论】:

      猜你喜欢
      • 2019-05-30
      • 2021-09-27
      • 1970-01-01
      • 1970-01-01
      • 2015-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-11
      相关资源
      最近更新 更多