Twitter 未显示我的页面的缩略图

发布于 2025-01-19 23:36:51 字数 1346 浏览 2 评论 0原文

我试图在用户共享我的网站页面时添加缩略图。根据 文档,有必要为卡片定义一些参数,即图像、标题、描述等。我正在页面上使用片段,但是,当我共享卡片时,我的图像不会显示。 这是我当前的

<!-- Twitter open-graph tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@twitter_user">
<meta name="twitter:site" content="@twitter_user">
<meta name="twitter:image:alt" content="Site name">
<meta name="twitter:image" content="https://examplesite.com/static/landing/img/img.png" />
<meta name="twitter:title" content="{% trans 'Site Title' %} - Site" />
<meta name="twitter:description" content="{% trans 'Site description' %}" />
<meta name="twitter:url" content="https://www.examplesite.com{% url path %}">

我正在使用绝对路径,即: https://examplesite.com/img/img.png(添加我的域名来加载图片),同样使用HTTPS协议,图片为80kb、1200x630px的PNG格式。

当我想使用此工具验证我的网站时,我得到了这个结果,其中图像不可见,而且根据日志,并未检测到所有定义的参数。

输入图片此处描述

I am trying to add a thumbnail when a user shares a page of my site. According to the documentation, it is necessary to define some parameters for the card i.e. image, title, description, etc. I am using the snippet on the page, however, when I share the card, my image does not show up.
This is my current <head>

<!-- Twitter open-graph tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@twitter_user">
<meta name="twitter:site" content="@twitter_user">
<meta name="twitter:image:alt" content="Site name">
<meta name="twitter:image" content="https://examplesite.com/static/landing/img/img.png" />
<meta name="twitter:title" content="{% trans 'Site Title' %} - Site" />
<meta name="twitter:description" content="{% trans 'Site description' %}" />
<meta name="twitter:url" content="https://www.examplesite.com{% url path %}">

I am using the absolute path, i.e.: https://examplesite.com/img/img.png (adding my domain to load the image), also using the HTTPS protocol, with an image in PNG format of 80kb and 1200x630px.

When I want to validate my site with this tool, I get this result, in which the image is not visible and also, according to the log, not all the defined parameters are detected.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文