Skip to content

【链接预览】博文链接在推特没有生成预览 #2513

Open
@snape2019

Description

@snape2019

描述bug

分享博文的链接到推特之后,只有一个链接,而不是生成一个预览卡片。
image

期望的正常结果

应该生成类似下图的预览
image

复现步骤

只要是博客的链接都无法预览
环境

  • 【必填】NotionNext版本 [4.4.6]
  • 【必填】主题 [Next]
  • 【必填】部署方案 [vercel]
  • 【可选】操作系统: [iOS, Android, macOS, windows]
  • 【可选】浏览器 [chrome, brave]

补充说明

推特官方有个检测twitter card生成的网站 https://cards-dev.twitter.com/validator
我提交链接后结果如图
Card validator
出现了“no card found"的提示。
我看了这个帖子的回复,知道了要在标签添加相应属性,然后我发现notionnext原本就有Twitter card的内容,但是不知为何没有生效,尝试在components/Globalhead.js进行了修改,但是依然没有解决,以下是涉及Twitter card的部份:

<meta name='keywords' content={keywords} />
      <meta name='description' content={description} />
      <meta property='og:locale' content={lang} />
      <meta property='og:title' content={title} />
      <meta property='og:description' content={description} />
      <meta property='og:url' content={url} />
      <meta property='og:image' content={image} />
      <meta property='og:site_name' content={siteConfig('TITLE')} />
      <meta property='og:type' content={type} />
      <meta name='twitter:card' content='summary' />
      <meta name="twitter:site" content="@lmlovekpop" />
      <meta name='twitter:description' content={description} />
      <meta name='twitter:title' content={title} />

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions