Inertiajs add open graph meta tag

Viewed 185

what I have tried it using the head tag by inertia.

<Head>
    <!-- HTML Meta Tags -->
    <title>{{ product.name }}</title>
    <meta name="description" :content="product.summary"/>

    <!-- Open Graph Meta Tags -->
    <meta property="og:url" :content="http://localhost/${product.slug}/${product.id}/`"/>
    <meta property="og:type" content="product"/>
    <meta property="og:title" :content="product.name"/>
    <meta property="og:description" :content="product.summary"/>

    <!-- Thumbnail Meta Tags -->
    <meta head-key="og:image" property="og:image"
          :content="`http://localhost/${product.thumbnail.path}-size-300.${product.thumbnail.mime}`"/>
    <meta property="og:image:width" content="300"/>
    <meta property="og:image:height" content="300"/>

    <!-- Locale Meta Tags -->
    <meta property="og:locale" content="en_MY"/>
    <meta property="og:locale:alternate" content="zh_CN"/>
</Head>

However, this code doesn't detected by the Facebook, since it is dynamic generated after javascript have run

Thank you.

1 Answers
Related