diff --git a/css-verification.png b/css-verification.png deleted file mode 100644 index 431e9a173..000000000 Binary files a/css-verification.png and /dev/null differ diff --git a/homepage-check.png b/homepage-check.png deleted file mode 100644 index 5bbb21b99..000000000 Binary files a/homepage-check.png and /dev/null differ diff --git a/homepage-desktop.png b/homepage-desktop.png deleted file mode 100644 index 58b2c98b0..000000000 Binary files a/homepage-desktop.png and /dev/null differ diff --git a/homepage-full.png b/homepage-full.png deleted file mode 100644 index 39bfe8a78..000000000 Binary files a/homepage-full.png and /dev/null differ diff --git a/homepage-object-contain.png b/homepage-object-contain.png deleted file mode 100644 index 8ec66b15a..000000000 Binary files a/homepage-object-contain.png and /dev/null differ diff --git a/homepage-white-theme.png b/homepage-white-theme.png deleted file mode 100644 index 7a70dd684..000000000 Binary files a/homepage-white-theme.png and /dev/null differ diff --git a/homepage.png b/homepage.png deleted file mode 100644 index a877f5a02..000000000 Binary files a/homepage.png and /dev/null differ diff --git a/mobile-homepage.png b/mobile-homepage.png deleted file mode 100644 index 2a6acca4b..000000000 Binary files a/mobile-homepage.png and /dev/null differ diff --git a/mobile-product-page.png b/mobile-product-page.png deleted file mode 100644 index 8becdbd2d..000000000 Binary files a/mobile-product-page.png and /dev/null differ diff --git a/src/app/blog/[slug]/page.tsx b/src/app/blog/[slug]/page.tsx index 0076448e3..a720c4807 100644 --- a/src/app/blog/[slug]/page.tsx +++ b/src/app/blog/[slug]/page.tsx @@ -6,9 +6,9 @@ import path from 'path'; import matter from 'gray-matter'; import { remark } from 'remark'; import html from 'remark-html'; - +import gfm from 'remark-gfm'; interface Props { - params: { slug: string }; + params: Promise<{ slug: string }>; } async function getPost(slug: string) { @@ -23,24 +23,32 @@ async function getPost(slug: string) { const { data, content } = matter(fileContent); const processedContent = await remark() + .use(gfm) .use(html, { sanitize: false }) .process(content); const contentHtml = processedContent.toString(); + // Support both 'category' and 'categories' field names + const category = data.category || (Array.isArray(data.categories) ? data.categories[0] : 'ทั่วไป'); + // Support both 'image' and 'featuredImage' field names + const image = data.image || data.featuredImage || '/images/2021/03/ppr-pipe_000C.jpg'; + return { slug, title: data.title || 'ไม่มีชื่อ', excerpt: data.excerpt || '', date: data.date || new Date().toISOString(), author: data.author || 'ดีลพลัสเทค', - category: data.category || 'ทั่วไป', - image: data.image || '/images/2021/03/ppr-pipe_000C.jpg', + category, + image, content: contentHtml, }; } export async function generateMetadata({ params }: Props) { - const post = await getPost(params.slug); + const { slug } = await params; + const decodedSlug = decodeURIComponent(slug); + const post = await getPost(decodedSlug); if (!post) return { title: 'ไม่พบบทความ' }; return { @@ -59,7 +67,9 @@ export async function generateStaticParams() { } export default async function BlogPostPage({ params }: Props) { - const post = await getPost(params.slug); + const { slug } = await params; + const decodedSlug = decodeURIComponent(slug); + const post = await getPost(decodedSlug); if (!post) { notFound(); diff --git a/src/app/blog/page.tsx b/src/app/blog/page.tsx index 18186a5dc..86d34a11a 100644 --- a/src/app/blog/page.tsx +++ b/src/app/blog/page.tsx @@ -18,14 +18,19 @@ function getBlogPosts() { const fileContent = fs.readFileSync(filePath, 'utf-8'); const { data } = matter(fileContent); + // Support both 'category' and 'categories' field names + const category = data.category || (Array.isArray(data.categories) ? data.categories[0] : 'ทั่วไป'); + // Support both 'image' and 'featuredImage' field names + const image = data.image || data.featuredImage || '/images/2021/03/ppr-pipe_000C.jpg'; + return { slug: filename.replace('.md', ''), title: data.title || 'ไม่มีชื่อ', excerpt: data.excerpt || '', date: data.date || new Date().toISOString(), author: data.author || 'ดีลพลัสเทค', - category: data.category || 'ทั่วไป', - image: data.image || '/images/2021/03/ppr-pipe_000C.jpg', + category, + image, }; }).sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime()); } diff --git a/src/app/contact-us/page.tsx b/src/app/contact-us/page.tsx index 00f333e37..ff6173b1b 100644 --- a/src/app/contact-us/page.tsx +++ b/src/app/contact-us/page.tsx @@ -19,160 +19,87 @@ export default function ContactPage() {

-
+
{/* Contact Info */} -
-
-

ข้อมูลติดต่อ

- -
-
-
- - - - -
-
-

ที่อยู่

-

{siteConfig.address}

-
+
+

ข้อมูลติดต่อ

+ +
+
+
+ + + +
- -
-
- - - -
-
-

โทรศัพท์

- - {siteConfig.phone} - -
+
+

ที่อยู่

+

{siteConfig.address}

+
-
-
- - - -
-
-

อีเมล

- - {siteConfig.email} - -
+
+
+ + +
+
+

โทรศัพท์

+ + {siteConfig.phone} + +
+
-
-
- - - -
-
-

LINE Official

- - {siteConfig.lineId} - -
+
+
+ + + +
+
+

อีเมล

+ + {siteConfig.email} + +
+
+ +
+
+ + + +
+
+

LINE Official

+ + {siteConfig.lineId} +
- - {/* Business Hours */} -
-

เวลาทำการ

-
    - {workHours.map((item) => ( -
  • - {item.day} - - {item.hours} - -
  • - ))} -
-
- {/* Contact Form */} -
-
-

ส่งข้อความถึงเรา

- -
-
-
- - -
-
- - -
-
- -
- - -
- -
- - -
- -
- -