首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >推特未正确显示summary_large_image卡

推特未正确显示summary_large_image卡
EN

Stack Overflow用户
提问于 2021-03-26 23:35:26
回答 1查看 398关注 0票数 0

我的元数据:

代码语言:javascript
运行
复制
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta property="twitter:domain" content="volkischexe.com">
<meta property="twitter:url" content="/germania/index.php">
<meta name="twitter:title" content="Germania: An Introduction">
<meta name="twitter:description" content="...">
<meta name="twitter:image" content="http://volkischexe.com/res/cards/germania-intro.png?605a78eeba1aa">

<!-- OpenGraph Card -->
<meta property="og:type" content="website">
<meta property="og:url" content="/germania/index.php">
<meta property="og:title" content="Germania: An Introduction">
<meta property="og:image" content="http://volkischexe.com/res/cards/germania-intro.png?605a78eeba1ae">
<meta property="og:description" content="...">

<!-- HTML Meta -->
<title>Germania: An Introduction</title>
<meta property="og:url" content="http://volkischexe.com/germania/">
<meta property="og:image" content="http://volkischexe.com/res/cards/germania-intro.png?605a78eeba1b1">
<meta property="og:title" content="Germania: An Introduction">
<meta property="og:description" content="...">  
<meta name="description" content="...">
<title>Germania: An Introduction</title>

这里我漏掉了什么?

ETA:验证器不会正确显示我的卡片,但如果我真的在tweet上发送它们,它们就会正常显示。所以验证器出了点问题,但只要我的名片出现在Twitter上,我就没问题。

EN

Stack Overflow用户

发布于 2021-03-27 05:19:17

有几件事可能会阻止Twitter为你的网站分享一张大卡片:

  • 你的一些Twitter元设置使用“内容”,但推特想要“名称”。
  • 你的站点正在重定向到https,所以在你的meta
  • 中使用URL的安全版本可以很好地包含Facebook的图像大小。
  • 和你不需要index.php文件名-你的服务器将自动提供index.php文件。

尝试用以下代码替换您的代码:

代码语言:javascript
运行
复制
<!-- OpenGraph Card -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://volkischexe.com/germania/">
<meta property="og:title" content="Germania: An Introduction">
<meta property="og:image" content="https://volkischexe.com/res/cards/germania-intro.png?605e46b26abc5">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:description" content="From where does the modern Western world derive its values and morals?">

<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:domain" content="volkischexe.com">
<meta name="twitter:url" content="https://volkischexe.com/germania/">
<meta name="twitter:title" content="Germania: An Introduction">
<meta name="twitter:description" content="From where does the modern Western world derive its values and morals?">
<meta name="twitter:image" content="https://volkischexe.com/res/cards/germania-intro.png?605e46b26abc1">

有一件事(可能会影响Twitter,也可能不会影响Twitter)是页面的开头缺少DOCTYPE和其他一些东西:

代码语言:javascript
运行
复制
<!DOCTYPE html>
    <html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Germania: An Introduction</title>
        <meta name="description" content="From where does the modern Western world derive its values and morals?">

        <link rel="preload" href="/res/AndBasR.ttf" as="font" type="font/ttf" crossorigin>
        <link rel="preload" href="/res/CelticHand.ttf" as="font" type="font/ttf" crossorigin>
        <link rel="preload" href="/res/Norse-Bold.otf" as="font" type="font/otf" crossorigin>

        <link rel="stylesheet" href="/res/main.css">

        <script src="/res/main.js"></script>

Twitter card validator的一件事是,有时当你点击预览卡按钮时,它不会重新整理你的网站。您可能需要重新启动浏览器(关闭并重新打开),然后重绘几次才能加载新版本。

票数 1
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66819942

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档