0

我是第一次使用 og 标签。不知道在哪里放置什么。我正在开发一个 Angular 应用程序,我需要在 facebook 中共享我的应用程序链接,并且它应该加载我提供的所有标签信息。

我已将以下代码放在 index.html 中

`<meta property="og:title" content="tt">
<meta property="og:image" content="https://www.google.com/imgres?imgurl=https%3A%2F%2Fjustsomething.co%2Fwp-content%2Fuploads%2F2013%2F10%2F9.jpg&imgrefurl=https%3A%2F%2Fjustsomething.co%2F24-amazing-pictures-that-will-make-you-want-to-visit-china%2F&tbnid=CMiYxtKxp1bk6M&vet=12ahUKEwiYzfnPwI_zAhUfj0sFHRymAN0QMygBegUIARCLAQ..i&docid=nhEeg7NaraSfbM&w=733&h=1100&itg=1&q=images&hl=en&ved=2ahUKEwiYzfnPwI_zAhUfj0sFHRymAN0QMygBegUIARCLAQ">
<meta property="og:url" content="www.google.com">`

然后在 ngOnInit() 中的一个组件中使用 updateTag() 进行更新,例如

`this.meta.updateTag({property: 'og:title', content: 'Its vote app'});
this.meta.updateTag({property: 'og:image', content: 'https://www.google.com/imgres?imgurl=https%3A%2F%2Fjustsomething.co%2Fwp-content%2Fuploads%2F2013%2F10%2F9.jpg&imgrefurl=https%3A%2F%2Fjustsomething.co%2F24-amazing-pictures-that-will-make-you-want-to-visit-china%2F&tbnid=CMiYxtKxp1bk6M&vet=12ahUKEwiYzfnPwI_zAhUfj0sFHRymAN0QMygBegUIARCLAQ..i&docid=nhEeg7NaraSfbM&w=733&h=1100&itg=1&q=images&hl=en&ved=2ahUKEwiYzfnPwI_zAhUfj0sFHRymAN0QMygBegUIARCLAQ'});
this.meta.updateTag({property: 'og:url', content: 'http://bf79-2401-4900-4bbe-baa4-61db-11ba-fb64-b337.ngrok.io/preview/vote/61483b6635b6d933cff747cc'});`

然后应该怎么做才能在我的 Facebook 帐户中呈现这些东西。

请帮帮我。谢谢你。

4

0 回答 0