我正在尝试在网站中实现 OpenGraph。这是我的元数据代码:
<!-- open-graph basic tags -->
<meta property="og:title" content="Philippine Standard Geographic Code API" />
<meta property="og:site_name" content="Wareneutron - PSGC API" />
<meta property="og:description" content="API used for listing all the region, province, city, municipality, barangay, and its data. Philippine Standard Geographic Codes (PSGC) data came from Philippine Statistics Authority." />
<meta property="og:url" content="https://psgc-api.wareneutron.com/" />
<meta property="og:type" content="website" />
<meta property="og:image" content="/assets/wareneutron_psgc_api_opengraph.jpg" />
<meta property="og:image:alt" content="PSGC Banner" />
<meta property="og:image:width" content="1280" />
<meta property="og:image:height" content="640" />
<!-- Twitter open-graph tags -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:image:alt" content="PSGC API Banner" />
It works fine with Facebook sharing debugger here's the output:
But the image is not showing in twitter card validator:
The image I'm trying to show is in my assets folder, here's the structure:
感谢你们对我的帮助。
Twitter 喜欢名称,而不是属性(OG 元标记使用属性)。
<!-- Twitter open-graph tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image:alt" content="PSGC API Banner">
<meta name="twitter:title" content="Philippine Standard Geographic Code API">
<meta name="twitter:description" content="API used for listing all the region, province, city, municipality, barangay, and its data. Philippine Standard Geographic Codes (PSGC) data came from Philippine Statistics Authority.">
<meta name="twitter:image" content="https://psgc-api.wareneutron.com/wareneutron_psgc_api_opengraph.jpg">
一件事与Twitter 卡片验证器 https://cards-dev.twitter.com/validator- 有时,当您单击“预览卡”按钮时,似乎不会重新抓取您的网站。为了测试更改代码是否有效,我将页面的副本上传到我网站的服务器,然后将其抓取。起初,我得到了一张没有图像的摘要卡,但我重新启动了浏览器(关闭并重新打开)并重新抓取 URL,它起作用了(显示了大图像)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)