diff --git a/package-lock.json b/package-lock.json index 9ac385b..1bbf916 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,12 +8,12 @@ "version": "0.0.1", "dependencies": { "@astrojs/check": "^0.5.10", - "@astrojs/sitemap": "^3.1.2", + "@astrojs/sitemap": "^3.1.4", "@astrojs/starlight": "^0.21.5", "@astrojs/starlight-tailwind": "^2.0.2", "@astrojs/tailwind": "^5.1.0", "@astrojs/vercel": "^7.5.3", - "astro": "^4.6.1", + "astro": "^4.6.3", "astro-compressor": "^0.4.1", "globby": "^14.0.1", "gsap": "^3.12.5", @@ -25,10 +25,10 @@ }, "devDependencies": { "@tailwindcss/forms": "^0.5.7", - "astro-vtbot": "^1.7.9", + "astro-vtbot": "^1.7.12", "prettier": "^3.2.5", "prettier-plugin-astro": "^0.13.0", - "prettier-plugin-tailwindcss": "^0.5.13", + "prettier-plugin-tailwindcss": "^0.5.14", "typescript": "^5.4.5" } }, @@ -194,11 +194,12 @@ } }, "node_modules/@astrojs/sitemap": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.1.2.tgz", - "integrity": "sha512-FxOJldIl5ltZ5CNjocQxHkAO9orwHBjqtaU28o4smobp9vowS0nbGp+I9CrPxkzWdl1crSDm9vjL9tnvG1DSug==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.1.4.tgz", + "integrity": "sha512-po8CqDCK14O6phU1mB5C8SyVLyQEa+7pJM8oXxs1mVh8DgvxxaA5E7lak1vzOmBcyyyHBW32jakGqNYc66sBRw==", "dependencies": { "sitemap": "^7.1.1", + "stream-replace-string": "^2.0.0", "zod": "^3.22.4" } }, @@ -2364,6 +2365,11 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/cookie": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.5.4.tgz", + "integrity": "sha512-7z/eR6O859gyWIAjuvBWFzNURmf2oPBmJlfVWkwehU5nzIyjwBsTh7WMmEEV4JFnHuQ3ex4oyTvfKzcyJVDBNA==" + }, "node_modules/@types/debug": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", @@ -2817,9 +2823,9 @@ } }, "node_modules/astro": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/astro/-/astro-4.6.1.tgz", - "integrity": "sha512-gcL22NEhuRi4wu9/x5Kn2eJf7nT6GeU5BxdN6AHbUnX6UzEDIWtpgHs5lBIZYExKbHKN9PjEGXWQzQtFwLU+5g==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.6.3.tgz", + "integrity": "sha512-p2zs1Gac+ysdc/yFCoc8pOXTZE5L9foAtmqUzUVL22WX68bYTRovd03GRs7J1MDpwzsl9kJtlK20ROpjyIFpNw==", "dependencies": { "@astrojs/compiler": "^2.7.1", "@astrojs/internal-helpers": "0.4.0", @@ -2832,6 +2838,7 @@ "@babel/traverse": "^7.23.3", "@babel/types": "^7.23.3", "@types/babel__core": "^7.20.4", + "@types/cookie": "^0.5.4", "acorn": "^8.11.2", "aria-query": "^5.3.0", "axobject-query": "^4.0.0", @@ -3161,9 +3168,9 @@ } }, "node_modules/astro-vtbot": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/astro-vtbot/-/astro-vtbot-1.7.9.tgz", - "integrity": "sha512-4HYeIHbdKxunje7ZH1/XyMgKEBlSmfbRH7zVDKHljYSi/Gl/IT4mahdOYSALE5O0/SdGY7AU6CYus/r/rS39vQ==", + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/astro-vtbot/-/astro-vtbot-1.7.12.tgz", + "integrity": "sha512-/botqljlm507eZtGY4+j5yEr9GbqR1unD7r0Rzg89dOU6MVjCrk//QSB7fg1NyDwur74LeYjcArMGE4FjOo/Dg==", "dev": true, "funding": { "type": "github", @@ -7761,9 +7768,9 @@ "devOptional": true }, "node_modules/prettier-plugin-tailwindcss": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.13.tgz", - "integrity": "sha512-2tPWHCFNC+WRjAC4SIWQNSOdcL1NNkydXim8w7TDqlZi+/ulZYz2OouAI6qMtkggnPt7lGamboj6LcTMwcCvoQ==", + "version": "0.5.14", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.14.tgz", + "integrity": "sha512-Puaz+wPUAhFp8Lo9HuciYKM2Y2XExESjeT+9NQoVFXZsPPnc9VYss2SpxdQ6vbatmt8/4+SN0oe0I1cPDABg9Q==", "dev": true, "engines": { "node": ">=14.21.3" @@ -9251,6 +9258,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/stream-replace-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-replace-string/-/stream-replace-string-2.0.0.tgz", + "integrity": "sha512-TlnjJ1C0QrmxRNrON00JvaFFlNh5TTG00APw23j74ET7gkQpTASi6/L2fuiav8pzK715HXtUeClpBTw2NPSn6w==" + }, "node_modules/streamx": { "version": "2.16.1", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.16.1.tgz", diff --git a/package.json b/package.json index 8535f5c..a9c1ff3 100644 --- a/package.json +++ b/package.json @@ -11,12 +11,12 @@ }, "dependencies": { "@astrojs/check": "^0.5.10", - "@astrojs/sitemap": "^3.1.2", + "@astrojs/sitemap": "^3.1.4", "@astrojs/starlight": "^0.21.5", "@astrojs/starlight-tailwind": "^2.0.2", "@astrojs/tailwind": "^5.1.0", "@astrojs/vercel": "^7.5.3", - "astro": "^4.6.1", + "astro": "^4.6.3", "astro-compressor": "^0.4.1", "globby": "^14.0.1", "gsap": "^3.12.5", @@ -28,10 +28,10 @@ }, "devDependencies": { "@tailwindcss/forms": "^0.5.7", - "astro-vtbot": "^1.7.9", + "astro-vtbot": "^1.7.12", "prettier": "^3.2.5", "prettier-plugin-astro": "^0.13.0", - "prettier-plugin-tailwindcss": "^0.5.13", + "prettier-plugin-tailwindcss": "^0.5.14", "typescript": "^5.4.5" } } diff --git a/src/content/config.ts b/src/content/config.ts index f095b80..dbb14b8 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -46,6 +46,12 @@ const productsCollection = defineCollection({ subTitle: z.string(), }) ).optional(), + tableData: z.array( + z.object({ + feature: z.array(z.string()), + description: z.array(z.array(z.string())), + }) + ).optional(), blueprints: z.object({ first: image().optional(), second: image().optional(), diff --git a/src/content/products/a765.md b/src/content/products/a765.md index 59e6745..3255c59 100644 --- a/src/content/products/a765.md +++ b/src/content/products/a765.md @@ -1,6 +1,6 @@ --- title: "SF-AB A765" -description: "Assorted Screw Set" +description: " " main: id: 2 content: | @@ -40,15 +40,14 @@ specificationsLeft: subTitle: "Each set includes a sufficient quantity of screws to handle a wide range of projects and tasks." - title: "Sizes" subTitle: "Available in various sizes to suit different project requirements, ensuring compatibility and versatility." -specificationsRight: - - title: "Thread Design" - subTitle: "Precision-engineered threads ensure a tight and secure fit, providing reliable fastening for your projects." - - title: "Durability" - subTitle: "Designed to withstand the rigors of everyday use, delivering long-lasting performance and reliability." - - title: "Quality Assurance" - subTitle: "Manufactured to meet or exceed industry standards, guaranteeing consistent quality and performance." - - title: "Applications" - subTitle: "Suitable for a wide range of applications, including woodworking, metalworking, construction, and more." +tableData: + - feature: ["Specification", "Value"] + description: + - ["Length (mm)", "Various"] + - ["Weight (g)", "N/A"] + - ["Material", "Stainless Steel"] + - ["Finish", "Assorted"] + - ["Package Contents", "Various screws in a set"] blueprints: first: "@/images/blueprint-1.avif" second: "@/images/blueprint-2.avif" diff --git a/src/pages/products/[...slug].astro b/src/pages/products/[...slug].astro index 0e180cc..b3a40a9 100644 --- a/src/pages/products/[...slug].astro +++ b/src/pages/products/[...slug].astro @@ -148,20 +148,65 @@ const pageTitle: string = `${product.data.title} | ${SITE.title}`; )) } -
- { - product.data.specificationsRight?.map((spec) => ( -
-

- {spec.title} -

-

- {spec.subTitle} -

+ { + product.data.specificationsRight ? ( +
+ {product.data.specificationsRight?.map((spec) => ( +
+

+ {spec.title} +

+

+ {spec.subTitle} +

+
+ ))} +
+ ) : product.data.tableData ? ( +
+
+
+
+
+ + + + {product.data.tableData?.[0].feature?.map( + (header) => ( + + ) + )} + + + + {product.data.tableData?.map((row) => + // Wrap each row's content in a separate element + row.description.map((rowData) => ( + + {/* Iterate through each cell value in the row's description array */} + {rowData.map((cellValue) => ( + // Render each cell value in its own + ))} + + )) + )} + +
+ {header} +
element + + {cellValue} +
+
+
+
- )) - } -
+
+ ) : null + }
@@ -199,7 +244,7 @@ const pageTitle: string = `${product.data.title} | ${SITE.title}`; - + - + \ No newline at end of file