diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-08 10:12:31 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-08 10:12:31 +0700 |
| commit | 0ca62faf89775496320025c170c942b2cb3e1a20 (patch) | |
| tree | 4107119c58e82aedf3478c165741824ff9cd08c1 /src/pages | |
| parent | e7383ff9601e47953c732fccf093e19993ec37cd (diff) | |
update theme color
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/blog/[slug].jsx | 2 | ||||
| -rw-r--r-- | src/pages/shop/quotation/finish.jsx | 4 | ||||
| -rw-r--r-- | src/pages/sitemap/products.xml.js | 30 | ||||
| -rw-r--r-- | src/pages/sitemap/products/[id].xml.js | 32 | ||||
| -rw-r--r-- | src/pages/video.jsx | 2 |
5 files changed, 66 insertions, 4 deletions
diff --git a/src/pages/blog/[slug].jsx b/src/pages/blog/[slug].jsx index 39f10b79..9305411d 100644 --- a/src/pages/blog/[slug].jsx +++ b/src/pages/blog/[slug].jsx @@ -20,7 +20,7 @@ export default function BlogDetail() { const contentClassNames = ` prose prose-gray - prose-a:text-red_r-10 + prose-a:text-danger-500 prose-a:no-underline prose-p:my-4 prose-headings:mt-6 diff --git a/src/pages/shop/quotation/finish.jsx b/src/pages/shop/quotation/finish.jsx index 52e03cf6..f6c0ac6b 100644 --- a/src/pages/shop/quotation/finish.jsx +++ b/src/pages/shop/quotation/finish.jsx @@ -19,8 +19,8 @@ export default function FinishQuotation() { <div className='mx-auto container'> <div className='m-4 md:m-0 md:mt-10 px-4 py-6 shadow-md border border-gray_r-3'> <div className='flex'> - <span className='p-3 mx-auto bg-yellow_r-3 border border-yellow_r-6 rounded'> - <EnvelopeIcon className='w-8 text-yellow_r-11' /> + <span className='p-3 mx-auto bg-warning-100 border border-warning-300 rounded'> + <EnvelopeIcon className='w-8 text-warning-800' /> </span> </div> <p className='h2 text-center mt-6'>Terima Kasih {auth?.name}</p> diff --git a/src/pages/sitemap/products.xml.js b/src/pages/sitemap/products.xml.js new file mode 100644 index 00000000..e5fc8029 --- /dev/null +++ b/src/pages/sitemap/products.xml.js @@ -0,0 +1,30 @@ +import productSearchApi from '@/lib/product/api/productSearchApi' +import { create } from 'xmlbuilder' +import _ from 'lodash-contrib' + +export async function getServerSideProps({ res }) { + const baseUrl = process.env.SELF_HOST + '/sitemap/products' + const limit = 2500 + const query = { limit } + const products = await productSearchApi({ query: _.toQuery(query) }) + const pageCount = Math.ceil(products.response.numFound / limit) + const pages = Array.from({ length: pageCount }, (_, i) => i + 1) + const sitemapIndex = create('sitemapindex', { encoding: 'UTF-8' }) + + const date = new Date() + pages.forEach((page) => { + const sitemap = sitemapIndex.ele('sitemap') + sitemap.ele('loc', `${baseUrl}/${page}.xml`) + sitemap.ele('lastmod', date.toISOString().slice(0, 10)) + }) + + res.setHeader('Content-Type', 'text/xml') + res.write(sitemapIndex.end()) + res.end() + + return { props: {} } +} + +export default function SitemapProducts() { + return null +} diff --git a/src/pages/sitemap/products/[id].xml.js b/src/pages/sitemap/products/[id].xml.js new file mode 100644 index 00000000..e9caaa00 --- /dev/null +++ b/src/pages/sitemap/products/[id].xml.js @@ -0,0 +1,32 @@ +import productSearchApi from '@/lib/product/api/productSearchApi' +import { create } from 'xmlbuilder' +import _ from 'lodash-contrib' +import { createSlug } from '@/core/utils/slug' + +export async function getServerSideProps({ res }) { + const baseUrl = process.env.SELF_HOST + '/shop/product' + const limit = 2500 + const query = { limit } + const products = await productSearchApi({ query: _.toQuery(query) }) + console.log(products); + // const sitemap = create('urlset', { encoding: 'UTF-8' }) + + // const date = new Date() + // pages.forEach((page) => { + // const url = sitemap.ele('url') + // url.ele('loc', createSlug(baseUrl, '', '')) + // url.ele('lastmod', date.toISOString().slice(0, 10)) + // url.ele('changefreq', 'weekly') + // url.ele('priority', '0.8') + // }) + + // res.setHeader('Content-Type', 'text/xml') + // res.write(sitemap.end()) + // res.end() + + return { props: {} } +} + +export default function SitemapProducts() { + return <></> +} diff --git a/src/pages/video.jsx b/src/pages/video.jsx index 7a2a5ecc..708c3368 100644 --- a/src/pages/video.jsx +++ b/src/pages/video.jsx @@ -45,7 +45,7 @@ export default function Video() { <div className='p-3'> <a href='https://www.youtube.com/@indoteknikb2bindustriale-c778' - className='text-red_r-11 mb-2 block' + className='text-danger-500 mb-2 block' > {video.channelName} </a> |
