While sharing link, it's showing default or blank

169 Views Asked by At

Open graph is not showing while sharing link it's show default or blank.. I want to set it as dynamic for each page.

async asyncData({ route, app }) {
  const appData = await 'my API call for data'
  if (appData) {
    return {
      pageTitle: appData.title,
      pageThumbnail: appData.thumbnail,
    }
  }
},

Here is my head section for setup open graph data

head() {
  const title = this.pageTitle + ' | SiteNAme'
  return {
    title,
    meta: [
      {
        hid: 'description',
        name: 'description',
        content: 'des...',
      },
      {
        hid: 'og:type',
        name: 'og:type',
        content: 'website',
      },
      {
        hid: 'og:title',
        name: 'og:title',
        content: title,
      },
      {
        hid: 'og:description',
        property: 'og:description',
        content: 'des...',
      },
      {
        hid: 'og:image',
        property: 'og:image',
        content: this.pageThumbnail ? this.pageThumbnail : '/local iage path',
      },
    ],
  }
},
0

There are 0 best solutions below