diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-29 17:02:57 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-29 17:02:57 +0700 |
| commit | 72329fb20c3bc7703590b85bd0c42ea32e7cfe61 (patch) | |
| tree | a5ad3074010154cf6d105a81f1175da844c0a798 /src/pages/shop/product | |
| parent | 0d42449cdd6e53cb8e98555660aefee81997a9d3 (diff) | |
SEO
Diffstat (limited to 'src/pages/shop/product')
| -rw-r--r-- | src/pages/shop/product/[slug].jsx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/pages/shop/product/[slug].jsx b/src/pages/shop/product/[slug].jsx index e8084cbe..84b848f0 100644 --- a/src/pages/shop/product/[slug].jsx +++ b/src/pages/shop/product/[slug].jsx @@ -2,6 +2,7 @@ import Seo from '@/core/components/Seo' import { getIdFromSlug } from '@/core/utils/slug' import productApi from '@/lib/product/api/productApi' import dynamic from 'next/dynamic' +import { useRouter } from 'next/router' const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout')) const Product = dynamic(() => import('@/lib/product/components/Product/Product')) @@ -23,9 +24,24 @@ export async function getServerSideProps(context) { } export default function ProductDetail({ product }) { + const router = useRouter() return ( <BasicLayout> - <Seo title={product?.name} /> + <Seo + title={product?.name + ' - Indoteknik.com' || ''} + description='Temukan pilihan produk B2B Industri & Alat Teknik untuk Perusahaan, UMKM & Pemerintah dengan lengkap, mudah dan transparan.' + openGraph={{ + url: process.env.NEXT_PUBLIC_SELF_HOST + router.asPath, + image: product.image, + type: 'product' + }} + additionalMetaTags={[ + { + name: 'keywords', + content: `${product.name}, Harga ${product.name}, Beli ${product.name}, Spesifikasi ${product.name}` + } + ]} + /> <Product product={product} /> </BasicLayout> ) |
