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 | |
| parent | 0d42449cdd6e53cb8e98555660aefee81997a9d3 (diff) | |
SEO
Diffstat (limited to 'src/pages/shop')
| -rw-r--r-- | src/pages/shop/brands/[slug].jsx | 15 | ||||
| -rw-r--r-- | src/pages/shop/brands/index.jsx | 3 | ||||
| -rw-r--r-- | src/pages/shop/cart.jsx | 3 | ||||
| -rw-r--r-- | src/pages/shop/checkout/[status].jsx | 15 | ||||
| -rw-r--r-- | src/pages/shop/checkout/index.jsx | 29 | ||||
| -rw-r--r-- | src/pages/shop/product/[slug].jsx | 18 | ||||
| -rw-r--r-- | src/pages/shop/quotation/finish.jsx | 5 | ||||
| -rw-r--r-- | src/pages/shop/quotation/index.jsx | 29 | ||||
| -rw-r--r-- | src/pages/shop/search.jsx | 3 |
9 files changed, 90 insertions, 30 deletions
diff --git a/src/pages/shop/brands/[slug].jsx b/src/pages/shop/brands/[slug].jsx index 33f81fa2..9c5193ad 100644 --- a/src/pages/shop/brands/[slug].jsx +++ b/src/pages/shop/brands/[slug].jsx @@ -2,6 +2,7 @@ import dynamic from 'next/dynamic' import { getIdFromSlug, getNameFromSlug } from '@/core/utils/slug' import { useRouter } from 'next/router' import _ from 'lodash' +import Seo from '@/core/components/Seo' const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout')) const ProductSearch = dynamic(() => import('@/lib/product/components/ProductSearch')) @@ -10,8 +11,22 @@ const Brand = dynamic(() => import('@/lib/brand/components/Brand')) export default function BrandDetail() { const router = useRouter() const { slug = '' } = router.query + + const brandName = getNameFromSlug(slug) return ( <BasicLayout> + <Seo + title={`Distributor ${brandName} Indonesia Harga Official Indoteknik.com`} + description='B2B Marketplace MRO & Industri dengan Layanan Pembayaran Tempo, Faktur Pajak, Online Quotation, Garansi Resmi & Harga Kompetitif' + additionalMetaTags={[ + { + property: 'keywords', + content: + `Jual ${brandName}, beli ${brandName}, Distributor ${brandName} Indonesia, cari ${brandName}, produk ${brandName}, ${brandName} Indonesia, harga ${brandName}` + } + ]} + /> + <Brand id={getIdFromSlug(slug)} /> {!_.isEmpty(router.query) && ( <ProductSearch diff --git a/src/pages/shop/brands/index.jsx b/src/pages/shop/brands/index.jsx index 77fde173..8159c965 100644 --- a/src/pages/shop/brands/index.jsx +++ b/src/pages/shop/brands/index.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' import MobileView from '@/core/components/views/MobileView' @@ -6,6 +7,8 @@ import BrandsComponent from '@/lib/brand/components/Brands' export default function Brands() { return ( <BasicLayout> + <Seo title='Brands Indoteknik.com' /> + <MobileView> <BrandsComponent /> </MobileView> diff --git a/src/pages/shop/cart.jsx b/src/pages/shop/cart.jsx index 9566cfcb..e574f14d 100644 --- a/src/pages/shop/cart.jsx +++ b/src/pages/shop/cart.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' import MobileView from '@/core/components/views/MobileView' @@ -9,6 +10,8 @@ const CartComponent = dynamic(() => import('@/lib/cart/components/Cart')) export default function Cart() { return ( <> + <Seo title='Keranjang Belanja Indoteknik.com' /> + <MobileView> <AppLayout title='Keranjang' withFooter={false}> <CartComponent /> diff --git a/src/pages/shop/checkout/[status].jsx b/src/pages/shop/checkout/[status].jsx index bf184c0e..7c39718c 100644 --- a/src/pages/shop/checkout/[status].jsx +++ b/src/pages/shop/checkout/[status].jsx @@ -3,6 +3,7 @@ import IsAuth from '@/lib/auth/components/IsAuth' import FinishCheckoutComponent from '@/lib/checkout/components/FinishCheckout' import { useRouter } from 'next/router' import axios from 'axios' +import Seo from '@/core/components/Seo' export async function getServerSideProps(context) { const { order_id } = context.query @@ -18,10 +19,14 @@ export default function Finish() { const router = useRouter() return ( - <IsAuth> - <BasicLayout> - <FinishCheckoutComponent query={router.query || {}} /> - </BasicLayout> - </IsAuth> + <> + <Seo title='Checkout Indoteknik.com' /> + + <IsAuth> + <BasicLayout> + <FinishCheckoutComponent query={router.query || {}} /> + </BasicLayout> + </IsAuth> + </> ) } diff --git a/src/pages/shop/checkout/index.jsx b/src/pages/shop/checkout/index.jsx index 30d2c730..13fc7056 100644 --- a/src/pages/shop/checkout/index.jsx +++ b/src/pages/shop/checkout/index.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -7,18 +8,22 @@ import CheckoutComponent from '@/lib/checkout/components/Checkout' export default function Checkout() { return ( - <IsAuth> - <MobileView> - <AppLayout title='Checkout'> - <CheckoutComponent /> - </AppLayout> - </MobileView> + <> + <Seo title='Checkout Indoteknik.com' /> - <DesktopView> - <BasicLayout> - <CheckoutComponent /> - </BasicLayout> - </DesktopView> - </IsAuth> + <IsAuth> + <MobileView> + <AppLayout title='Checkout'> + <CheckoutComponent /> + </AppLayout> + </MobileView> + + <DesktopView> + <BasicLayout> + <CheckoutComponent /> + </BasicLayout> + </DesktopView> + </IsAuth> + </> ) } 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> ) diff --git a/src/pages/shop/quotation/finish.jsx b/src/pages/shop/quotation/finish.jsx index 32638b62..52e03cf6 100644 --- a/src/pages/shop/quotation/finish.jsx +++ b/src/pages/shop/quotation/finish.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import Link from '@/core/components/elements/Link/Link' import BasicLayout from '@/core/components/layouts/BasicLayout' import useAuth from '@/core/hooks/useAuth' @@ -10,6 +11,9 @@ export default function FinishQuotation() { const router = useRouter() const { id } = router.query return ( + <> + <Seo title='Quotation Indoteknik.com' /> + <IsAuth> <BasicLayout> <div className='mx-auto container'> @@ -39,5 +43,6 @@ export default function FinishQuotation() { </div> </BasicLayout> </IsAuth> + </> ) } diff --git a/src/pages/shop/quotation/index.jsx b/src/pages/shop/quotation/index.jsx index efb35db9..bd086b72 100644 --- a/src/pages/shop/quotation/index.jsx +++ b/src/pages/shop/quotation/index.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -7,18 +8,22 @@ import QuotationComponent from '@/lib/quotation/components/Quotation' export default function Quotation() { return ( - <IsAuth> - <MobileView> - <AppLayout title='Quotation'> - <QuotationComponent /> - </AppLayout> - </MobileView> + <> + <Seo title='Quotation Indoteknik.com' /> - <DesktopView> - <BasicLayout> - <QuotationComponent /> - </BasicLayout> - </DesktopView> - </IsAuth> + <IsAuth> + <MobileView> + <AppLayout title='Quotation'> + <QuotationComponent /> + </AppLayout> + </MobileView> + + <DesktopView> + <BasicLayout> + <QuotationComponent /> + </BasicLayout> + </DesktopView> + </IsAuth> + </> ) } diff --git a/src/pages/shop/search.jsx b/src/pages/shop/search.jsx index 345b715a..d21d72cd 100644 --- a/src/pages/shop/search.jsx +++ b/src/pages/shop/search.jsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic' import { useRouter } from 'next/router' import _ from 'lodash-contrib' +import Seo from '@/core/components/Seo' const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout')) const ProductSearch = dynamic(() => import('@/lib/product/components/ProductSearch')) @@ -10,6 +11,8 @@ export default function Search() { return ( <BasicLayout> + <Seo title={`Cari produk ${router.query.q} di Indoteknik.com`} /> + {!_.isEmpty(router.query) && ( <ProductSearch query={router.query} |
