From ded5ac26c4e9d3df709c74548d9ad19c41d2d485 Mon Sep 17 00:00:00 2001 From: babayaga Date: Sat, 22 Mar 2025 12:16:06 +0100 Subject: [PATCH] adding bullshit filter --- .astro/collections/resources.schema.json | 2 +- package-lock.json | 961 +--------------------- package.json | 2 +- src/components/howtos/.kbot/params.json | 8 +- src/components/howtos/Detail.astro | 255 +++--- src/components/howtos/Detail2.astro | 146 ++-- src/components/howtos/howto_sample.json | 339 ++++++++ src/components/howtos/todos.md | 13 +- src/components/howtos/todos.sh | 5 +- src/model/howto.sh | 5 +- src/model/howto.ts | 104 ++- src/model/howto_sample.js | 339 ++++++++ src/model/howto_sample.json | 339 ++++++++ src/model/todos-howto.md | 47 -- src/model/todos.md | 14 + src/pages/[locale]/howtos/[...path].astro | 2 +- 16 files changed, 1405 insertions(+), 1176 deletions(-) create mode 100644 src/components/howtos/howto_sample.json create mode 100644 src/model/howto_sample.js create mode 100644 src/model/howto_sample.json delete mode 100644 src/model/todos-howto.md create mode 100644 src/model/todos.md diff --git a/.astro/collections/resources.schema.json b/.astro/collections/resources.schema.json index fa367d0..a0bdcee 100644 --- a/.astro/collections/resources.schema.json +++ b/.astro/collections/resources.schema.json @@ -23,7 +23,7 @@ "format": "unix-time" } ], - "default": "2025-03-21T23:09:43.108Z" + "default": "2025-03-22T10:51:39.637Z" }, "description": { "type": "string", diff --git a/package-lock.json b/package-lock.json index d064535..e06cfa5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "github-slugger": "^2.0.0", "glob": "^11.0.1", "got": "^14.4.6", - "imagetools": "file:packages/imagetools", + "imagetools": "file:../astro-components/packages/imagetools", "lighthouse": "^12.3.0", "markdown-it": "^14.1.0", "marked": "^15.0.7", @@ -83,6 +83,33 @@ "sass-embedded": "^1.83.4" } }, + "../astro-components/packages/imagetools": { + "version": "0.9.0", + "license": "MIT", + "dependencies": { + "@astropub/codecs": "0.4.4", + "@polymech/fs": "file:../../../polymech-mono/packages/fs", + "file-type": "17.1.1", + "find-cache-dir": "3.3.2", + "find-up": "^6.3.0", + "object-hash": "3.0.0", + "p-map": "^7.0.3", + "potrace": "2.1.8", + "ts-retry": "^6.0.0" + }, + "devDependencies": { + "vitest": "^0.12.4" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + }, + "optionalDependencies": { + "imagetools-core": "3.0.2" + }, + "peerDependencies": { + "astro": ">=0.26 || >=1.0.0-beta" + } + }, "../astro-components/packages/polymech": { "name": "@polymech/astro-base", "version": "0.5.6", @@ -590,12 +617,6 @@ "astro": "^1.2.1 || ^2.0.0 || ^3.0.0-beta.0 || ^3.0.0 || ^4.0.0 || ^5.0.0-beta.0 || ^5.0.0" } }, - "node_modules/@astropub/codecs": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@astropub/codecs/-/codecs-0.4.4.tgz", - "integrity": "sha512-jHmdZK2B7dfelTsVzkWVb93WPjuKkHz07xUcyg5WtUxTeCCxdDVLnvZlsB5PC2r7HmJLf03TP1QYb1ZgrEebyQ==", - "license": "(CC0-1.0 AND Apache-2.0 AND BSD-3-Clause)" - }, "node_modules/@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -3325,23 +3346,6 @@ "@babel/types": "^7.20.7" } }, - "node_modules/@types/chai": { - "version": "4.3.20", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", - "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/chai-subset": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.5.tgz", - "integrity": "sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/chai": "*" - } - }, "node_modules/@types/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", @@ -3530,18 +3534,6 @@ "node": ">=14.6" } }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "license": "MIT", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, "node_modules/acorn": { "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", @@ -3804,16 +3796,6 @@ "node": ">=0.10.0" } }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -4683,25 +4665,6 @@ "node": ">=0.8" } }, - "node_modules/chai": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", - "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", - "dev": true, - "license": "MIT", - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.1.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/chalk": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", @@ -4754,19 +4717,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-func-name": "^2.0.2" - }, - "engines": { - "node": "*" - } - }, "node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -5201,12 +5151,6 @@ "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", "license": "ISC" }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "license": "MIT" - }, "node_modules/component-emitter": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", @@ -5457,19 +5401,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/deep-eql": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", - "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -5973,346 +5904,6 @@ "@esbuild/win32-x64": "0.25.0" } }, - "node_modules/esbuild-android-64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.54.tgz", - "integrity": "sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-android-arm64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.54.tgz", - "integrity": "sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-darwin-64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.54.tgz", - "integrity": "sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-darwin-arm64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.54.tgz", - "integrity": "sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.54.tgz", - "integrity": "sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-arm64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.54.tgz", - "integrity": "sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-32": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.54.tgz", - "integrity": "sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.54.tgz", - "integrity": "sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.54.tgz", - "integrity": "sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.54.tgz", - "integrity": "sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-mips64le": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.54.tgz", - "integrity": "sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-ppc64le": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.54.tgz", - "integrity": "sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-riscv64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.54.tgz", - "integrity": "sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-s390x": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.54.tgz", - "integrity": "sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-netbsd-64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.54.tgz", - "integrity": "sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-openbsd-64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.54.tgz", - "integrity": "sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-sunos-64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.54.tgz", - "integrity": "sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-windows-32": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.54.tgz", - "integrity": "sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-windows-64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.54.tgz", - "integrity": "sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-windows-arm64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.54.tgz", - "integrity": "sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -6496,30 +6087,12 @@ "node": ">=0.10.0" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", "license": "MIT" }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "license": "MIT", - "engines": { - "node": ">=0.8.x" - } - }, "node_modules/exif-parser": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz", @@ -7193,16 +6766,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/get-intrinsic": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", @@ -8049,7 +7612,7 @@ "license": "MIT" }, "node_modules/imagetools": { - "resolved": "packages/imagetools", + "resolved": "../astro-components/packages/imagetools", "link": true }, "node_modules/immediate": { @@ -9062,19 +8625,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/local-pkg": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", - "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, "node_modules/localforage": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz", @@ -9228,16 +8778,6 @@ "integrity": "sha512-/c2kL+Vnp1jnV6K6RpDTHK3dgg0Tu2VVp+elEiJpjfS1UyY7AjOYHohRug6wT0OpoX2qFgNORndE9RqesfVxWQ==", "license": "MIT" }, - "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-func-name": "^2.0.1" - } - }, "node_modules/lowercase-keys": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", @@ -12214,16 +11754,6 @@ "node": "20 || >=22" } }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/peek-readable": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-6.1.1.tgz", @@ -12873,71 +12403,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "license": "MIT" }, - "node_modules/readable-web-to-node-stream": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.4.tgz", - "integrity": "sha512-9nX56alTf5bwXQ3ZDipHJhusu9NTQJ/CVPtb/XHAJCXihZeitfJvIRS4GqQ/mfIoOE3IelHMrpayVrosdHBuLw==", - "license": "MIT", - "dependencies": { - "readable-stream": "^4.7.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "node_modules/readable-web-to-node-stream/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/readable-web-to-node-stream/node_modules/readable-stream": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", - "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", - "license": "MIT", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/readable-web-to-node-stream/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -15051,26 +14516,6 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, - "node_modules/tinypool": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.1.3.tgz", - "integrity": "sha512-2IfcQh7CP46XGWGGbdyO4pjcKqsmVqFAPcXfPxcPXmOWt9cYkTP9HcDmGgsfijYoAEc4z9qcpM/BaBz46Y9/CQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tinyspy": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-0.3.3.tgz", - "integrity": "sha512-gRiUR8fuhUf0W9lzojPf1N1euJYA30ISebSfgca8z76FOvXtVXqd5ojEIaKLWbDQhAaC3ibxZIjqbyi4ybjcTw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/tldts-core": { "version": "6.1.78", "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.78.tgz", @@ -15231,16 +14676,6 @@ "node": "*" } }, - "node_modules/type-detect": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", - "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/type-fest": { "version": "4.35.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.35.0.tgz", @@ -16165,160 +15600,6 @@ } } }, - "node_modules/vitest": { - "version": "0.12.10", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.12.10.tgz", - "integrity": "sha512-TVoI6fM7rZ1zIMDjcviY8Dg5XIaPqBwDweaI3oUwvWqUz68cbM49CIHNMkF+UVoSjl94wXiBRdNhsT4ekgWuGA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/chai": "^4.3.1", - "@types/chai-subset": "^1.3.3", - "chai": "^4.3.6", - "debug": "^4.3.4", - "local-pkg": "^0.4.1", - "tinypool": "^0.1.3", - "tinyspy": "^0.3.2", - "vite": "^2.9.9" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": ">=v14.16.0" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - }, - "peerDependencies": { - "@vitest/ui": "*", - "c8": "*", - "happy-dom": "*", - "jsdom": "*" - }, - "peerDependenciesMeta": { - "@vitest/ui": { - "optional": true - }, - "c8": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } - } - }, - "node_modules/vitest/node_modules/@esbuild/linux-loong64": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.14.54.tgz", - "integrity": "sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vitest/node_modules/esbuild": { - "version": "0.14.54", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.54.tgz", - "integrity": "sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/linux-loong64": "0.14.54", - "esbuild-android-64": "0.14.54", - "esbuild-android-arm64": "0.14.54", - "esbuild-darwin-64": "0.14.54", - "esbuild-darwin-arm64": "0.14.54", - "esbuild-freebsd-64": "0.14.54", - "esbuild-freebsd-arm64": "0.14.54", - "esbuild-linux-32": "0.14.54", - "esbuild-linux-64": "0.14.54", - "esbuild-linux-arm": "0.14.54", - "esbuild-linux-arm64": "0.14.54", - "esbuild-linux-mips64le": "0.14.54", - "esbuild-linux-ppc64le": "0.14.54", - "esbuild-linux-riscv64": "0.14.54", - "esbuild-linux-s390x": "0.14.54", - "esbuild-netbsd-64": "0.14.54", - "esbuild-openbsd-64": "0.14.54", - "esbuild-sunos-64": "0.14.54", - "esbuild-windows-32": "0.14.54", - "esbuild-windows-64": "0.14.54", - "esbuild-windows-arm64": "0.14.54" - } - }, - "node_modules/vitest/node_modules/rollup": { - "version": "2.77.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.77.3.tgz", - "integrity": "sha512-/qxNTG7FbmefJWoeeYJFbHehJ2HNWnjkAFRKzWN/45eNBBF/r8lo992CwcJXEzyVxs5FmfId+vTSTQDb+bxA+g==", - "dev": true, - "license": "MIT", - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=10.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/vitest/node_modules/vite": { - "version": "2.9.18", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.18.tgz", - "integrity": "sha512-sAOqI5wNM9QvSEE70W3UGMdT8cyEn0+PmJMTFvTB8wB0YbYUWw3gUbY62AOyrXosGieF2htmeLATvNxpv/zNyQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "^0.14.27", - "postcss": "^8.4.13", - "resolve": "^1.22.0", - "rollup": ">=2.59.0 <2.78.0" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": ">=12.2.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - }, - "peerDependencies": { - "less": "*", - "sass": "*", - "stylus": "*" - }, - "peerDependenciesMeta": { - "less": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - } - } - }, "node_modules/ware": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/ware/-/ware-1.3.0.tgz", @@ -16817,6 +16098,7 @@ }, "packages/imagetools": { "version": "0.9.0", + "extraneous": true, "license": "MIT", "dependencies": { "@astropub/codecs": "0.4.4", @@ -16839,189 +16121,6 @@ "peerDependencies": { "astro": ">=0.26 || >=1.0.0-beta" } - }, - "packages/imagetools/node_modules/file-type": { - "version": "17.1.1", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.1.tgz", - "integrity": "sha512-heRUMZHby2Qj6wZAA3YHeMlRmZNQTcb6VxctkGmM+mcM6ROQKvHpr7SS6EgdfEhH+s25LDshBjvPx/Ecm+bOVQ==", - "license": "MIT", - "dependencies": { - "readable-web-to-node-stream": "^3.0.2", - "strtok3": "^7.0.0-alpha.7", - "token-types": "^5.0.0-alpha.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/file-type?sponsor=1" - } - }, - "packages/imagetools/node_modules/find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", - "license": "MIT", - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" - } - }, - "packages/imagetools/node_modules/find-up": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", - "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", - "license": "MIT", - "dependencies": { - "locate-path": "^7.1.0", - "path-exists": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "packages/imagetools/node_modules/imagetools-core": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/imagetools-core/-/imagetools-core-3.0.2.tgz", - "integrity": "sha512-DlArpNiefCc1syIqvOONcE8L8IahN8GjwaEjm6wIJIvuKoFoI1RcKmWWfS2dYxSlTiSp2X5b3JnHDjUXmWqlVA==", - "license": "MIT", - "optional": true, - "dependencies": { - "sharp": "^0.29.3" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "packages/imagetools/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "license": "MIT", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "packages/imagetools/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "license": "MIT", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "packages/imagetools/node_modules/peek-readable": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.4.2.tgz", - "integrity": "sha512-peBp3qZyuS6cNIJ2akRNG1uo1WJ1d0wTxg/fxMdZ0BqCVhx242bSFHM9eNqflfJVS9SsgkzgT/1UgnsurBOTMg==", - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "packages/imagetools/node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "license": "MIT", - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "packages/imagetools/node_modules/pkg-dir/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "license": "MIT", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "packages/imagetools/node_modules/pkg-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "license": "MIT", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "packages/imagetools/node_modules/pkg-dir/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "packages/imagetools/node_modules/strtok3": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.1.1.tgz", - "integrity": "sha512-mKX8HA/cdBqMKUr0MMZAFssCkIGoZeSCMXgnt79yKxNFguMLVFgRe6wB+fsL0NmoHDbeyZXczy7vEPSoo3rkzg==", - "license": "MIT", - "dependencies": { - "@tokenizer/token": "^0.3.0", - "peek-readable": "^5.1.3" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "packages/imagetools/node_modules/token-types": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", - "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", - "license": "MIT", - "dependencies": { - "@tokenizer/token": "^0.3.0", - "ieee754": "^1.2.1" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } } } } diff --git a/package.json b/package.json index ce0227c..d1b5bd3 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "github-slugger": "^2.0.0", "glob": "^11.0.1", "got": "^14.4.6", - "imagetools": "file:packages/imagetools", + "imagetools": "file:../astro-components/packages/imagetools", "lighthouse": "^12.3.0", "markdown-it": "^14.1.0", "marked": "^15.0.7", diff --git a/src/components/howtos/.kbot/params.json b/src/components/howtos/.kbot/params.json index 78b4e67..5747b96 100644 --- a/src/components/howtos/.kbot/params.json +++ b/src/components/howtos/.kbot/params.json @@ -7,17 +7,17 @@ }, { "role": "user", - "content": "USER Preferences : ## Todos\r\n\r\n- for Astro, tailwind\r\n- no react or additional dependencies\r\n- IHowto: import { IHowto } from \"@/model/howto.js\"\r\n- For text, use {text} (import { i18n as Translate } from \"@polymech/astro-base\")\r\n- data is provided via `import { getCollection } from 'astro:content', eg: const items = await getCollection('howtos')`\r\n\r\n- [ ] update Detail.astro : improve layout and css\r\n" + "content": "USER Preferences : ## Todos\r\n\r\n- for Astro, tailwind\r\n- no react or additional dependencies\r\n\r\n## Todos\r\n\r\nDetail.astro\r\n\r\n- [ ] when rendering howto.steps, apply a list of filters (some are async)\r\n - [ ] replace all crlf with html line breaks\r\n - [ ] render links via \r\n - [ ] let me transform or reject links (black list)\r\n - [ ] let me filter certain step descriptions for certain words/phrases\r\n" }, { "role": "user", "path": "Detail.astro", - "content": "---\nimport fs from \"fs\";\nimport path from \"path\";\nimport { IHowto, asset_local_rel } from \"@/model/howto\";\nimport { Img } from \"imagetools/components\";\nimport { i18n as Translate } from \"@polymech/astro-base\";\nimport { files, forward_slash } from \"@polymech/commons\";\nimport BaseLayout from \"@/layouts/BaseLayout.astro\";\nimport Wrapper from \"@/components/containers/Wrapper.astro\";\nimport GalleryK from \"@/components/polymech/GalleryK.astro\";\nimport { HOWTO_FILES_WEB, HOWTO_FILES_ABS } from \"config/config.js\";\n\ninterface Props {\n howto: IHowto;\n}\nconst { howto } = Astro.props;\nconst coverLocaleRel = await asset_local_rel(howto, howto.cover_image);\nconst howto_abs = HOWTO_FILES_ABS(howto.slug);\n\nlet model_files: any = [...files(howto_abs, \"**/**/*.(step|stp)\")];\nmodel_files = model_files.map((f) =>\n forward_slash(`${howto.slug}/${path.relative(path.resolve(howto_abs), f)}`),\n);\n---\n\n \n
\n
\n

\n {howto.title}\n

\n
\n {\n howto.tags.map((tag) => (\n \n {tag}\n \n ))\n }\n
\n \n
\n \n
\n \n
\n
\n Difficulty:\n {howto.difficulty_level}\n
\n
\n Time:\n {howto.time}\n
\n
\n Views:\n {howto.total_views}\n
\n
\n Created by:\n {howto._createdBy}\n
\n
\n Country:\n {howto.creatorCountry}\n
\n
\n\n \n
\n

\n \")}\n />\n

\n
\n
\n
\n\n \n
\n {\n howto.steps.map((step, index) => (\n
\n

\n \n {index + 1}\n \n {step.title}\n

\n\n
\n

\n \n

\")} />\n \n

\n
\n\n {step.images && step.images.length > 0 && (\n
\n \n
\n )}\n
\n ))\n }\n
\n \n
\n
\n
\n \n Created: {\n new Date(howto._created).toLocaleDateString()\n }\n \n
\n
\n \n Found useful by: {\n howto.votedUsefulBy.length\n }\n people\n \n
\n
\n
\n
\n \n\n" + "content": "---\nimport fs from \"fs\";\nimport path from \"path\";\n\nimport { IHowto, asset_local_rel } from \"@/model/howto.js\";\nimport { Img } from \"imagetools/components\";\nimport { sync as write } from \"@polymech/fs/write\";\nimport { i18n as Translate } from \"@polymech/astro-base\";\nimport { files, forward_slash } from \"@polymech/commons\";\nimport BaseLayout from \"@/layouts/BaseLayout.astro\";\nimport Wrapper from \"@/components/containers/Wrapper.astro\";\nimport GalleryK from \"@/components/polymech/GalleryK.astro\";\nimport { HOWTO_FILES_WEB, HOWTO_FILES_ABS } from \"config/config.js\";\n\ninterface Props {\n howto: IHowto;\n}\nconst { howto } = Astro.props;\nconst coverLocaleRel = await asset_local_rel(howto, howto.cover_image);\n\nconst howto_abs = HOWTO_FILES_ABS(howto.slug);\nlet model_files: any = [...files(howto_abs, \"**/**/*.(step|stp)\")];\nmodel_files = model_files.map((f) =>\n forward_slash(`${howto.slug}/${path.relative(path.resolve(howto_abs), f)}`),\n);\nwrite(\"./src/model/howto_sample.json\", howto);\n---\n\n\n \n
\n \n
\n

\n {howto.title}\n

\n
\n {\n howto.tags.map((tag) => (\n \n {tag}\n \n ))\n }\n
\n \n
\n\n \n
\n \n
    \n
  • \n Difficulty:\n {howto.difficulty_level}\n
  • \n
  • \n Time Required:\n {howto.time}\n
  • \n
  • \n Views:\n {howto.total_views}\n
  • \n
  • \n Creator:\n {howto._createdBy}\n
  • \n
  • \n Country:\n {howto.creatorCountry}\n
  • \n
  • \n Downloads:\n {howto.total_downloads}\n
  • \n
\n\n \n

\n \n

\")} />\n \n

\n\n \n {\n howto.files.length > 0 && (\n
\n

\n Resources\n

\n
    \n {howto.files.map((file) => (\n
  • \n \n {file.name}\n \n
  • \n ))}\n
\n
\n )\n }\n \n Browse Files\n \n
\n\n \n
\n

\n Steps\n

\n
    \n {\n howto.steps.map((step, index) => (\n \n
    \n \n {index + 1}\n \n

    \n {step.title}\n

    \n
    \n
    \n
    \")} />\n
    \n {step.images && step.images.length > 0 && (\n \n )}\n \n ))\n }\n
\n
\n\n \n
\n
\n Created on: {\n new Date(howto._created).toLocaleDateString()\n }\n \n Found useful by\n {howto.votedUsefulBy.length}\n people\n \n
\n
\n
\n
\n
\n" }, { "role": "user", - "path": "howto.json", - "content": "{\r\n \"_createdBy\": \"gus-merckel\",\r\n \"mentions\": [],\r\n \"_deleted\": false,\r\n \"fileLink\": \"\",\r\n \"slug\": \"cut-out-shapes-out-of-plastic-sheets-with-a-cnc-\",\r\n \"_modified\": \"2023-10-27T18:09:36.519Z\",\r\n \"previousSlugs\": [\r\n \"cut-out-shapes-out-of-plastic-sheets-with-a-cnc-\"\r\n ],\r\n \"_created\": \"2023-08-23T18:20:09.098Z\",\r\n \"description\": \"In this how to, I will show you our process to cut HDPE Sheets using a X-Carve CNC.\\n\\nHere is the full video in spanish with subtitles https://www.youtube.com/watch?v=4LrrFz802To \",\r\n \"votedUsefulBy\": [\r\n \"sigolene\",\r\n \"mattia\",\r\n \"uillinoispreciousplastics\"\r\n ],\r\n \"creatorCountry\": \"mx\",\r\n \"total_downloads\": 0,\r\n \"title\": \"Cut out shapes out of plastic sheets with a CNC \",\r\n \"time\": \"< 5 hours\",\r\n \"files\": [],\r\n \"difficulty_level\": \"Medium\",\r\n \"_id\": \"038gjWgLjiyYknbEjDeI\",\r\n \"tags\": {\r\n \"RTCBJAFa05YBVVBy0KeO\": true\r\n },\r\n \"category\":\"machines\",\r\n \"total_views\": 232,\r\n \"_contentModifiedTimestamp\": \"2023-08-23T18:20:09.098Z\",\r\n \"cover_image\": {\r\n \"name\": \"IMG_20200605_142311.jpg\",\r\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2F038gjWgLjiyYknbEjDeI%2FIMG_20200605_142311.jpg?alt=media&token=c272c174-1adc-45af-967b-771adce7295d\",\r\n \"type\": \"image/jpeg\",\r\n \"fullPath\": \"uploads/howtos/038gjWgLjiyYknbEjDeI/IMG_20200605_142311.jpg\",\r\n \"updated\": \"2021-04-05T15:09:00.605Z\",\r\n \"size\": 124661,\r\n \"timeCreated\": \"2021-04-05T15:09:00.605Z\",\r\n \"contentType\": \"image/jpeg\"\r\n },\r\n \"comments\": [],\r\n \"moderatorFeedback\": \"\",\r\n \"steps\": [\r\n {\r\n \"title\": \"Measure the plastic sheet\",\r\n \"text\": \"For this step we need to measure our plastic sheet: Height, Width and Thickness. Our X-Carve machine works with the CAM Software EASEL, for me, the easiest software for CNC milling out there. \\n\\nThe cool thing about Easel (https://easel.inventables.com/) is that you can \\\"simulate\\\" your actual material and THEY EVEN HAVE HDPE 2-Colors in their cutting material lists!!\\n\\n\\n\",\r\n \"images\": [\r\n {\r\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/1.jpg\",\r\n \"name\": \"1.jpg\",\r\n \"size\": 74095,\r\n \"type\": \"image/jpeg\",\r\n \"timeCreated\": \"2021-03-26T19:42:05.766Z\",\r\n \"contentType\": \"image/jpeg\",\r\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F1.jpg?alt=media&token=293d733d-05a5-494a-9340-47f4564f1939\",\r\n \"updated\": \"2021-03-26T19:42:05.766Z\"\r\n },\r\n {\r\n \"contentType\": \"image/jpeg\",\r\n \"timeCreated\": \"2021-03-26T19:42:05.669Z\",\r\n \"updated\": \"2021-03-26T19:42:05.669Z\",\r\n \"size\": 69665,\r\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F2.jpg?alt=media&token=004f50f1-97ac-4df4-9ba9-f463aa4cbca3\",\r\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/2.jpg\",\r\n \"name\": \"2.jpg\",\r\n \"type\": \"image/jpeg\"\r\n }\r\n ],\r\n \"_animationKey\": \"unique1\"\r\n },\r\n {\r\n \"text\": \"Using the CNC clamps from the X-Carve, secure the sheet to the table, \",\r\n \"_animationKey\": \"unique2\",\r\n \"images\": [\r\n {\r\n \"updated\": \"2021-03-26T19:42:06.249Z\",\r\n \"size\": 55544,\r\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/3.jpg\",\r\n \"timeCreated\": \"2021-03-26T19:42:06.249Z\",\r\n \"name\": \"3.jpg\",\r\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F3.jpg?alt=media&token=0b9c1914-1c75-429e-b34a-1e2b3706edef\",\r\n \"contentType\": \"image/jpeg\",\r\n \"type\": \"image/jpeg\"\r\n }\r\n ],\r\n \"title\": \"Secure sheet \"\r\n },\r\n {\r\n \"title\": \"Choosing a file to cut \",\r\n \"text\": \"Now we go to our illustrator, such as Inkscape to design a vector file or download and open source one frome https://thenounproject.com/.\\n\\nWe download the SVG file, which is an open source vector format and import it to Easel. \\n\",\r\n \"images\": [\r\n {\r\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F4.jpg?alt=media&token=1cd2d49d-9335-4bb1-ac2a-e625322ca604\",\r\n \"contentType\": \"image/jpeg\",\r\n \"timeCreated\": \"2021-03-26T19:42:06.727Z\",\r\n \"updated\": \"2021-03-26T19:42:06.727Z\",\r\n \"name\": \"4.jpg\",\r\n \"size\": 42952,\r\n \"type\": \"image/jpeg\",\r\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/4.jpg\"\r\n },\r\n {\r\n \"size\": 69255,\r\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/5.jpg\",\r\n \"updated\": \"2021-03-26T19:42:06.833Z\",\r\n \"timeCreated\": \"2021-03-26T19:42:06.833Z\",\r\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F5.jpg?alt=media&token=7cca786a-7d47-43bb-900b-b8d101c276b4\",\r\n \"name\": \"5.jpg\",\r\n \"contentType\": \"image/jpeg\",\r\n \"type\": \"image/jpeg\"\r\n }\r\n ],\r\n \"_animationKey\": \"unique3\"\r\n },\r\n {\r\n \"text\": \"Now with the file we can choose the width we want to carve/cut and then we go to cut and start the wizzard:\\n- We check that the sheet is fixed.\\n- We also specify the cutting bit, we are using a 1/8 flat flute bit. \\n- We tell the machine where the coordinate 0-0 is, which we always choose as the down left corner.\\n- We raise the bit, turn on the Router!!!\\n\\nAND PUM THE MAGIC BEGINS!!\",\r\n \"title\": \"Follow the cutting Wizzard\",\r\n \"images\": [\r\n {\r\n \"timeCreated\": \"2021-03-26T19:42:07.493Z\",\r\n \"size\": 72226,\r\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/6.jpg\",\r\n \"updated\": \"2021-03-26T19:42:07.493Z\",\r\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F6.jpg?alt=media&token=ba7195dd-7771-435f-a188-057457697332\",\r\n \"contentType\": \"image/jpeg\",\r\n \"type\": \"image/jpeg\",\r\n \"name\": \"6.jpg\"\r\n },\r\n {\r\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/7.jpg\",\r\n \"size\": 52424,\r\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F7.jpg?alt=media&token=a3d5820c-cfe2-484e-8f76-f861ab8b756d\",\r\n \"contentType\": \"image/jpeg\",\r\n \"type\": \"image/jpeg\",\r\n \"timeCreated\": \"2021-03-26T19:42:07.308Z\",\r\n \"updated\": \"2021-03-26T19:42:07.308Z\",\r\n \"name\": \"7.jpg\"\r\n },\r\n {\r\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/8.jpg\",\r\n \"name\": \"8.jpg\",\r\n \"type\": \"image/jpeg\",\r\n \"timeCreated\": \"2021-03-26T19:42:07.346Z\",\r\n \"size\": 55264,\r\n \"contentType\": \"image/jpeg\",\r\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F8.jpg?alt=media&token=1c9816d7-3a99-4f41-8d3c-acc2670240f6\",\r\n \"updated\": \"2021-03-26T19:42:07.346Z\"\r\n }\r\n ],\r\n \"_animationKey\": \"uniquenisc2v\"\r\n },\r\n {\r\n \"text\": \"You take now your glasses or object and postprocess them and of course show it to your friends, family and so on.\\n\\n\\n\",\r\n \"images\": [\r\n {\r\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/9.jpg\",\r\n \"contentType\": \"image/jpeg\",\r\n \"timeCreated\": \"2021-03-26T19:42:08.147Z\",\r\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F9.jpg?alt=media&token=4dcfe37d-e1ad-41e5-a590-40b4c37c5e1a\",\r\n \"name\": \"9.jpg\",\r\n \"updated\": \"2021-03-26T19:42:08.147Z\",\r\n \"type\": \"image/jpeg\",\r\n \"size\": 82214\r\n }\r\n ],\r\n \"_animationKey\": \"uniquesgl34\",\r\n \"title\": \"Post-production and show case\"\r\n },\r\n {\r\n \"_animationKey\": \"uniquem4y0yi\",\r\n \"title\": \"Hack it and try it yourself\",\r\n \"text\": \"You can try this project with other types of CNC machines, even manual Routers or manual saw, as I did on this video: https://youtu.be/gxkcffQD3eQ, but the important thing is that you share what you do and help this community to grow!!!\\n\\nShare your ideas and comments!\",\r\n \"images\": [\r\n {\r\n \"contentType\": \"image/jpeg\",\r\n \"timeCreated\": \"2021-04-05T15:09:01.445Z\",\r\n \"fullPath\": \"uploads/howtos/038gjWgLjiyYknbEjDeI/IMG_20200605_142311.jpg\",\r\n \"type\": \"image/jpeg\",\r\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2F038gjWgLjiyYknbEjDeI%2FIMG_20200605_142311.jpg?alt=media&token=f94152ff-f923-4054-a3ad-d8ec588856fa\",\r\n \"size\": 124661,\r\n \"updated\": \"2021-04-05T15:09:01.445Z\",\r\n \"name\": \"IMG_20200605_142311.jpg\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"moderation\": \"accepted\"\r\n }" + "path": "howto_sample.json", + "content": "{\n \"_createdBy\": \"gus-merckel\",\n \"mentions\": [],\n \"_deleted\": false,\n \"fileLink\": \"\",\n \"slug\": \"cut-out-shapes-out-of-plastic-sheets-with-a-cnc-\",\n \"_modified\": \"2023-10-27T18:09:36.519Z\",\n \"previousSlugs\": [\n \"cut-out-shapes-out-of-plastic-sheets-with-a-cnc-\"\n ],\n \"_created\": \"2023-08-23T18:20:09.098Z\",\n \"description\": \"In this how to, I will show you our process to cut HDPE Sheets using a X-Carve CNC.\\n\\nHere is the full video in spanish with subtitles https://www.youtube.com/watch?v=4LrrFz802To \",\n \"votedUsefulBy\": [\n \"sigolene\",\n \"mattia\",\n \"uillinoispreciousplastics\"\n ],\n \"creatorCountry\": \"mx\",\n \"total_downloads\": 0,\n \"title\": \"Cut out shapes out of plastic sheets with a CNC \",\n \"time\": \"< 5 hours\",\n \"files\": [],\n \"difficulty_level\": \"Medium\",\n \"_id\": \"038gjWgLjiyYknbEjDeI\",\n \"tags\": [\n \"HDPE\"\n ],\n \"total_views\": 232,\n \"_contentModifiedTimestamp\": \"2023-08-23T18:20:09.098Z\",\n \"cover_image\": {\n \"name\": \"IMG_20200605_142311.jpg\",\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2F038gjWgLjiyYknbEjDeI%2FIMG_20200605_142311.jpg?alt=media&token=c272c174-1adc-45af-967b-771adce7295d\",\n \"type\": \"image/jpeg\",\n \"fullPath\": \"uploads/howtos/038gjWgLjiyYknbEjDeI/IMG_20200605_142311.jpg\",\n \"updated\": \"2021-04-05T15:09:00.605Z\",\n \"size\": 124661,\n \"timeCreated\": \"2021-04-05T15:09:00.605Z\",\n \"contentType\": \"image/jpeg\"\n },\n \"comments\": [],\n \"moderatorFeedback\": \"\",\n \"steps\": [\n {\n \"title\": \"Measure the plastic sheet\",\n \"text\": \"For this step we need to measure our plastic sheet: Height, Width and Thickness. Our X-Carve machine works with the CAM Software EASEL, for me, the easiest software for CNC milling out there. \\n\\nThe cool thing about Easel (https://easel.inventables.com/) is that you can \\\"simulate\\\" your actual material and THEY EVEN HAVE HDPE 2-Colors in their cutting material lists!!\\n\\n\\n\",\n \"images\": [\n {\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/1.jpg\",\n \"name\": \"1.jpg\",\n \"size\": 74095,\n \"type\": \"image/jpeg\",\n \"timeCreated\": \"2021-03-26T19:42:05.766Z\",\n \"contentType\": \"image/jpeg\",\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F1.jpg?alt=media&token=293d733d-05a5-494a-9340-47f4564f1939\",\n \"updated\": \"2021-03-26T19:42:05.766Z\",\n \"src\": \"/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/1.jpg\",\n \"alt\": \"1.jpg\"\n },\n {\n \"contentType\": \"image/jpeg\",\n \"timeCreated\": \"2021-03-26T19:42:05.669Z\",\n \"updated\": \"2021-03-26T19:42:05.669Z\",\n \"size\": 69665,\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F2.jpg?alt=media&token=004f50f1-97ac-4df4-9ba9-f463aa4cbca3\",\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/2.jpg\",\n \"name\": \"2.jpg\",\n \"type\": \"image/jpeg\",\n \"src\": \"/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/2.jpg\",\n \"alt\": \"2.jpg\"\n }\n ],\n \"_animationKey\": \"unique1\"\n },\n {\n \"text\": \"Using the CNC clamps from the X-Carve, secure the sheet to the table, \",\n \"_animationKey\": \"unique2\",\n \"images\": [\n {\n \"updated\": \"2021-03-26T19:42:06.249Z\",\n \"size\": 55544,\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/3.jpg\",\n \"timeCreated\": \"2021-03-26T19:42:06.249Z\",\n \"name\": \"3.jpg\",\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F3.jpg?alt=media&token=0b9c1914-1c75-429e-b34a-1e2b3706edef\",\n \"contentType\": \"image/jpeg\",\n \"type\": \"image/jpeg\",\n \"src\": \"/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/3.jpg\",\n \"alt\": \"3.jpg\"\n }\n ],\n \"title\": \"Secure sheet \"\n },\n {\n \"title\": \"Choosing a file to cut \",\n \"text\": \"Now we go to our illustrator, such as Inkscape to design a vector file or download and open source one frome https://thenounproject.com/.\\n\\nWe download the SVG file, which is an open source vector format and import it to Easel. \\n\",\n \"images\": [\n {\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F4.jpg?alt=media&token=1cd2d49d-9335-4bb1-ac2a-e625322ca604\",\n \"contentType\": \"image/jpeg\",\n \"timeCreated\": \"2021-03-26T19:42:06.727Z\",\n \"updated\": \"2021-03-26T19:42:06.727Z\",\n \"name\": \"4.jpg\",\n \"size\": 42952,\n \"type\": \"image/jpeg\",\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/4.jpg\",\n \"src\": \"/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/4.jpg\",\n \"alt\": \"4.jpg\"\n },\n {\n \"size\": 69255,\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/5.jpg\",\n \"updated\": \"2021-03-26T19:42:06.833Z\",\n \"timeCreated\": \"2021-03-26T19:42:06.833Z\",\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F5.jpg?alt=media&token=7cca786a-7d47-43bb-900b-b8d101c276b4\",\n \"name\": \"5.jpg\",\n \"contentType\": \"image/jpeg\",\n \"type\": \"image/jpeg\",\n \"src\": \"/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/5.jpg\",\n \"alt\": \"5.jpg\"\n }\n ],\n \"_animationKey\": \"unique3\"\n },\n {\n \"text\": \"Now with the file we can choose the width we want to carve/cut and then we go to cut and start the wizzard:\\n- We check that the sheet is fixed.\\n- We also specify the cutting bit, we are using a 1/8 flat flute bit. \\n- We tell the machine where the coordinate 0-0 is, which we always choose as the down left corner.\\n- We raise the bit, turn on the Router!!!\\n\\nAND PUM THE MAGIC BEGINS!!\",\n \"title\": \"Follow the cutting Wizzard\",\n \"images\": [\n {\n \"timeCreated\": \"2021-03-26T19:42:07.493Z\",\n \"size\": 72226,\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/6.jpg\",\n \"updated\": \"2021-03-26T19:42:07.493Z\",\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F6.jpg?alt=media&token=ba7195dd-7771-435f-a188-057457697332\",\n \"contentType\": \"image/jpeg\",\n \"type\": \"image/jpeg\",\n \"name\": \"6.jpg\",\n \"src\": \"/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/6.jpg\",\n \"alt\": \"6.jpg\"\n },\n {\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/7.jpg\",\n \"size\": 52424,\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F7.jpg?alt=media&token=a3d5820c-cfe2-484e-8f76-f861ab8b756d\",\n \"contentType\": \"image/jpeg\",\n \"type\": \"image/jpeg\",\n \"timeCreated\": \"2021-03-26T19:42:07.308Z\",\n \"updated\": \"2021-03-26T19:42:07.308Z\",\n \"name\": \"7.jpg\",\n \"src\": \"/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/7.jpg\",\n \"alt\": \"7.jpg\"\n },\n {\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/8.jpg\",\n \"name\": \"8.jpg\",\n \"type\": \"image/jpeg\",\n \"timeCreated\": \"2021-03-26T19:42:07.346Z\",\n \"size\": 55264,\n \"contentType\": \"image/jpeg\",\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F8.jpg?alt=media&token=1c9816d7-3a99-4f41-8d3c-acc2670240f6\",\n \"updated\": \"2021-03-26T19:42:07.346Z\",\n \"src\": \"/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/8.jpg\",\n \"alt\": \"8.jpg\"\n }\n ],\n \"_animationKey\": \"uniquenisc2v\"\n },\n {\n \"text\": \"You take now your glasses or object and postprocess them and of course show it to your friends, family and so on.\\n\\n\\n\",\n \"images\": [\n {\n \"fullPath\": \"uploads/howtos/pbo0Pe44aTngvlD04kGf/9.jpg\",\n \"contentType\": \"image/jpeg\",\n \"timeCreated\": \"2021-03-26T19:42:08.147Z\",\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F9.jpg?alt=media&token=4dcfe37d-e1ad-41e5-a590-40b4c37c5e1a\",\n \"name\": \"9.jpg\",\n \"updated\": \"2021-03-26T19:42:08.147Z\",\n \"type\": \"image/jpeg\",\n \"size\": 82214,\n \"src\": \"/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/9.jpg\",\n \"alt\": \"9.jpg\"\n }\n ],\n \"_animationKey\": \"uniquesgl34\",\n \"title\": \"Post-production and show case\"\n },\n {\n \"_animationKey\": \"uniquem4y0yi\",\n \"title\": \"Hack it and try it yourself\",\n \"text\": \"You can try this project with other types of CNC machines, even manual Routers or manual saw, as I did on this video: https://youtu.be/gxkcffQD3eQ, but the important thing is that you share what you do and help this community to grow!!!\\n\\nShare your ideas and comments!\",\n \"images\": [\n {\n \"contentType\": \"image/jpeg\",\n \"timeCreated\": \"2021-04-05T15:09:01.445Z\",\n \"fullPath\": \"uploads/howtos/038gjWgLjiyYknbEjDeI/IMG_20200605_142311.jpg\",\n \"type\": \"image/jpeg\",\n \"downloadUrl\": \"https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2F038gjWgLjiyYknbEjDeI%2FIMG_20200605_142311.jpg?alt=media&token=f94152ff-f923-4054-a3ad-d8ec588856fa\",\n \"size\": 124661,\n \"updated\": \"2021-04-05T15:09:01.445Z\",\n \"name\": \"IMG_20200605_142311.jpg\",\n \"src\": \"/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/IMG_20200605_142311.jpg\",\n \"alt\": \"IMG_20200605_142311.jpg\"\n }\n ]\n }\n ],\n \"moderation\": \"accepted\",\n \"user\": {\n \"_modified\": \"2024-01-08T13:28:33.484Z\",\n \"_id\": \"gus-merckel\",\n \"subType\": \"mix\",\n \"moderation\": \"accepted\",\n \"_deleted\": false,\n \"verified\": false,\n \"type\": \"workspace\",\n \"location\": {\n \"lat\": 19.3935,\n \"lng\": -99.1656\n },\n \"_created\": \"2024-01-08T13:28:33.484Z\",\n \"geo\": {\n \"latitude\": 19.3935,\n \"lookupSource\": \"coordinates\",\n \"longitude\": -99.1656,\n \"localityLanguageRequested\": \"en\",\n \"continent\": \"North America\",\n \"continentCode\": \"NA\",\n \"countryName\": \"Mexico\",\n \"countryCode\": \"MX\",\n \"principalSubdivision\": \"Ciudad de Mexico\",\n \"principalSubdivisionCode\": \"MX-CMX\",\n \"city\": \"Mexico City\",\n \"locality\": \"Benito Juarez\",\n \"postcode\": \"03103\",\n \"plusCode\": \"76F29RVM+CQ\",\n \"localityInfo\": {\n \"administrative\": [\n {\n \"name\": \"Mexico\",\n \"description\": \"country in North America\",\n \"isoName\": \"Mexico\",\n \"order\": 2,\n \"adminLevel\": 2,\n \"isoCode\": \"MX\",\n \"wikidataId\": \"Q96\",\n \"geonameId\": 3996063\n },\n {\n \"name\": \"Mexico City\",\n \"description\": \"capital and largest city of Mexico\",\n \"order\": 5,\n \"adminLevel\": 4,\n \"wikidataId\": \"Q1489\",\n \"geonameId\": 3530597\n },\n {\n \"name\": \"Ciudad de Mexico\",\n \"description\": \"capital and largest city of Mexico\",\n \"isoName\": \"Ciudad de Mexico\",\n \"order\": 6,\n \"adminLevel\": 4,\n \"isoCode\": \"MX-CMX\",\n \"wikidataId\": \"Q1489\",\n \"geonameId\": 3527646\n },\n {\n \"name\": \"Benito Juarez\",\n \"description\": \"territorial demarcation of the Mexico City in Mexico\",\n \"order\": 7,\n \"adminLevel\": 6,\n \"wikidataId\": \"Q2356998\",\n \"geonameId\": 3827406\n }\n ],\n \"informative\": [\n {\n \"name\": \"North America\",\n \"description\": \"continent and northern subcontinent of the Americas\",\n \"isoName\": \"North America\",\n \"order\": 1,\n \"isoCode\": \"NA\",\n \"wikidataId\": \"Q49\",\n \"geonameId\": 6255149\n },\n {\n \"name\": \"America/Mexico_City\",\n \"description\": \"time zone\",\n \"order\": 3\n },\n {\n \"name\": \"Greater Mexico City\",\n \"description\": \"geographical object\",\n \"order\": 4,\n \"wikidataId\": \"Q665894\"\n },\n {\n \"name\": \"03103\",\n \"description\": \"postal code\",\n \"order\": 8\n }\n ]\n }\n },\n \"data\": {\n \"urls\": [\n {\n \"name\": \"Email\",\n \"url\": \"mailto:gustavomerckel@gmail.com\"\n },\n {\n \"name\": \"Facebook\",\n \"url\": \"https://www.facebook.com/pl%c3%a1stico-chido-110888520718193\"\n },\n {\n \"name\": \"sponsor the work\",\n \"url\": \"https://www.patreon.com/one_army\"\n }\n ],\n \"description\": \"Plástico Chido builds and modifies the PP machines, and also experiments with CNC and Laser Cut\",\n \"services\": [\n {\n \"welding\": false,\n \"assembling\": false,\n \"machining\": false,\n \"electronics\": false,\n \"molds\": false\n }\n ],\n \"title\": \"Plástico Chido\",\n \"images\": []\n },\n \"detail\": {\n \"services\": [],\n \"urls\": []\n }\n },\n \"category\": {\n \"label\": \"uncategorized\"\n }\n}" } ], "tools": [] diff --git a/src/components/howtos/Detail.astro b/src/components/howtos/Detail.astro index 1eabc6e..cfc1dd6 100644 --- a/src/components/howtos/Detail.astro +++ b/src/components/howtos/Detail.astro @@ -1,8 +1,10 @@ --- import fs from "fs"; import path from "path"; -import { IHowto, asset_local_rel } from "@/model/howto"; + +import { IHowto, asset_local_rel } from "@/model/howto.js"; import { Img } from "imagetools/components"; +import { sync as write } from "@polymech/fs/write"; import { i18n as Translate } from "@polymech/astro-base"; import { files, forward_slash } from "@polymech/commons"; import BaseLayout from "@/layouts/BaseLayout.astro"; @@ -15,146 +17,161 @@ interface Props { } const { howto } = Astro.props; const coverLocaleRel = await asset_local_rel(howto, howto.cover_image); -const howto_abs = HOWTO_FILES_ABS(howto.slug); +const howto_abs = HOWTO_FILES_ABS(howto.slug); let model_files: any = [...files(howto_abs, "**/**/*.(step|stp)")]; model_files = model_files.map((f) => forward_slash(`${howto.slug}/${path.relative(path.resolve(howto_abs), f)}`), ); +write("./src/components/howtos/howto_sample.json", howto); --- - - -
-
-

+ + + +
+ +
+

{howto.title}

-
+
{ howto.tags.map((tag) => ( - + {tag} )) }
- -
- {"none"} -
- -
-
- Difficulty: - {howto.difficulty_level} -
-
- Time: - {howto.time} -
-
- Views: - {howto.total_views} -
-
- Created by: - {howto._createdBy} -
-
- Country: - {howto.creatorCountry} -
-
- - -
-

-

")} - /> -

-
-
-

Resources

-
- { - howto.files.map((file) => ( - - {file.name} - - )) - } -
- - Browse Files -
+ {"Cover
- -
+ +
+ +
    +
  • + Difficulty: + {howto.difficulty_level} +
  • +
  • + Time Required: + {howto.time} +
  • +
  • + Views: + {howto.total_views} +
  • +
  • + Creator: + {howto._createdBy} +
  • +
  • + Country: + {howto.creatorCountry} +
  • +
  • + Downloads: + {howto.total_downloads} +
  • +
+ + +

+ +

")} /> + +

+ + { - howto.steps.map((step, index) => ( -
-

- - {index + 1} - - {step.title} + howto.files.length > 0 && ( +
+

+ Resources

- -
-

- -

")} /> - -

-
- - {step.images && step.images.length > 0 && ( -
- -
- )} +
- )) + ) } -
- -
-
-
- - Created: { - new Date(howto._created).toLocaleDateString() - } - -
-
- - Found useful by: { - howto.votedUsefulBy.length - } - people - -
+ + Browse Files + +

+ + +
+

+ Steps +

+
    + { + howto.steps.map((step, index) => ( +
  1. +
    + + {index + 1} + +

    + {step.title} +

    +
    +
    +
    ")} /> +
    + {step.images && step.images.length > 0 && ( + + )} +
  2. + )) + } +
+
+ + +
+
+ Created on: { + new Date(howto._created).toLocaleDateString() + } + + Found useful by + {howto.votedUsefulBy.length} + people +
-
+
diff --git a/src/components/howtos/Detail2.astro b/src/components/howtos/Detail2.astro index 2c3cac0..515eb5d 100644 --- a/src/components/howtos/Detail2.astro +++ b/src/components/howtos/Detail2.astro @@ -1,8 +1,10 @@ --- import fs from "fs"; import path from "path"; + import { IHowto, asset_local_rel } from "@/model/howto.js"; import { Img } from "imagetools/components"; +import { sync as write } from "@polymech/fs/write"; import { i18n as Translate } from "@polymech/astro-base"; import { files, forward_slash } from "@polymech/commons"; import BaseLayout from "@/layouts/BaseLayout.astro"; @@ -18,8 +20,10 @@ const coverLocaleRel = await asset_local_rel(howto, howto.cover_image); const howto_abs = HOWTO_FILES_ABS(howto.slug); let model_files: any = [...files(howto_abs, "**/**/*.(step|stp)")]; -model_files = model_files.map((f) => forward_slash(`${howto.slug}/${path.relative(path.resolve(howto_abs), f)}`)); - +model_files = model_files.map((f) => + forward_slash(`${howto.slug}/${path.relative(path.resolve(howto_abs), f)}`), +); +write("./src/model/howto_sample.json", howto); --- @@ -31,11 +35,13 @@ model_files = model_files.map((f) => forward_slash(`${howto.slug}/${path.relativ {howto.title}

- {Object.keys(howto.tags).map((tag) => ( - - {tag} - - ))} + { + howto.tags.map((tag) => ( + + {tag} + + )) + }
forward_slash(`${howto.slug}/${path.relativ
    -
  • Difficulty: {howto.difficulty_level}
  • -
  • Time Required: {howto.time}
  • -
  • Views: {howto.total_views}
  • -
  • Creator: {howto._createdBy}
  • -
  • Country: {howto.creatorCountry}
  • -
  • Downloads: {howto.total_downloads}
  • +
  • + Difficulty: + {howto.difficulty_level} +
  • +
  • + Time Required: + {howto.time} +
  • +
  • + Views: + {howto.total_views} +
  • +
  • + Creator: + {howto._createdBy} +
  • +
  • + Country: + {howto.creatorCountry} +
  • +
  • + Downloads: + {howto.total_downloads} +

-

")}>
+
")} />

- {howto.files.length > 0 && ( -
-

Resources

- -
- )} + { + howto.files.length > 0 && ( +
+

+ Resources +

+ +
+ ) + } forward_slash(`${howto.slug}/${path.relativ
-

Steps

+

+ Steps +

    - {howto.steps.map((step, index) => ( -
  1. -
    - {index + 1} -

    {step.title}

    -
    -
    -
    ')}>
    -
    - {step.images && step.images.length > 0 && - () - } -
  2. - ))} + { + howto.steps.map((step, index) => ( +
  3. +
    + + {index + 1} + +

    + {step.title} +

    +
    +
    +
    ")} /> +
    + {step.images && step.images.length > 0 && ( + + )} +
  4. + )) + }
- Created on: {new Date(howto._created).toLocaleDateString()} + Created on: { + new Date(howto._created).toLocaleDateString() + } - Found useful by {howto.votedUsefulBy.length} people + Found useful by + {howto.votedUsefulBy.length} + people
- diff --git a/src/components/howtos/howto_sample.json b/src/components/howtos/howto_sample.json new file mode 100644 index 0000000..edd4baa --- /dev/null +++ b/src/components/howtos/howto_sample.json @@ -0,0 +1,339 @@ +{ + "_createdBy": "gus-merckel", + "mentions": [], + "_deleted": false, + "fileLink": "", + "slug": "cut-out-shapes-out-of-plastic-sheets-with-a-cnc-", + "_modified": "2023-10-27T18:09:36.519Z", + "previousSlugs": [ + "cut-out-shapes-out-of-plastic-sheets-with-a-cnc-" + ], + "_created": "2023-08-23T18:20:09.098Z", + "description": "In this how to, I will show you our process to cut HDPE Sheets using a X-Carve CNC.\n\nHere is the full video in spanish with subtitles https://www.youtube.com/watch?v=4LrrFz802To ", + "votedUsefulBy": [ + "sigolene", + "mattia", + "uillinoispreciousplastics" + ], + "creatorCountry": "mx", + "total_downloads": 0, + "title": "Cut out shapes out of plastic sheets with a CNC ", + "time": "< 5 hours", + "files": [], + "difficulty_level": "Medium", + "_id": "038gjWgLjiyYknbEjDeI", + "tags": [ + "HDPE" + ], + "total_views": 232, + "_contentModifiedTimestamp": "2023-08-23T18:20:09.098Z", + "cover_image": { + "name": "IMG_20200605_142311.jpg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2F038gjWgLjiyYknbEjDeI%2FIMG_20200605_142311.jpg?alt=media&token=c272c174-1adc-45af-967b-771adce7295d", + "type": "image/jpeg", + "fullPath": "uploads/howtos/038gjWgLjiyYknbEjDeI/IMG_20200605_142311.jpg", + "updated": "2021-04-05T15:09:00.605Z", + "size": 124661, + "timeCreated": "2021-04-05T15:09:00.605Z", + "contentType": "image/jpeg" + }, + "comments": [], + "moderatorFeedback": "", + "steps": [ + { + "title": "Measure the plastic sheet", + "text": "For this step we need to measure our plastic sheet: Height, Width and Thickness. Our X-Carve machine works with the CAM Software EASEL, for me, the easiest software for CNC milling out there. \n\nThe cool thing about Easel (https://easel.inventables.com/) is that you can \"simulate\" your actual material and THEY EVEN HAVE HDPE 2-Colors in their cutting material lists!!\n\n\n", + "images": [ + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/1.jpg", + "name": "1.jpg", + "size": 74095, + "type": "image/jpeg", + "timeCreated": "2021-03-26T19:42:05.766Z", + "contentType": "image/jpeg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F1.jpg?alt=media&token=293d733d-05a5-494a-9340-47f4564f1939", + "updated": "2021-03-26T19:42:05.766Z", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/1.jpg", + "alt": "1.jpg" + }, + { + "contentType": "image/jpeg", + "timeCreated": "2021-03-26T19:42:05.669Z", + "updated": "2021-03-26T19:42:05.669Z", + "size": 69665, + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F2.jpg?alt=media&token=004f50f1-97ac-4df4-9ba9-f463aa4cbca3", + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/2.jpg", + "name": "2.jpg", + "type": "image/jpeg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/2.jpg", + "alt": "2.jpg" + } + ], + "_animationKey": "unique1" + }, + { + "text": "Using the CNC clamps from the X-Carve, secure the sheet to the table, ", + "_animationKey": "unique2", + "images": [ + { + "updated": "2021-03-26T19:42:06.249Z", + "size": 55544, + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/3.jpg", + "timeCreated": "2021-03-26T19:42:06.249Z", + "name": "3.jpg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F3.jpg?alt=media&token=0b9c1914-1c75-429e-b34a-1e2b3706edef", + "contentType": "image/jpeg", + "type": "image/jpeg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/3.jpg", + "alt": "3.jpg" + } + ], + "title": "Secure sheet " + }, + { + "title": "Choosing a file to cut ", + "text": "Now we go to our illustrator, such as Inkscape to design a vector file or download and open source one frome https://thenounproject.com/.\n\nWe download the SVG file, which is an open source vector format and import it to Easel. \n", + "images": [ + { + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F4.jpg?alt=media&token=1cd2d49d-9335-4bb1-ac2a-e625322ca604", + "contentType": "image/jpeg", + "timeCreated": "2021-03-26T19:42:06.727Z", + "updated": "2021-03-26T19:42:06.727Z", + "name": "4.jpg", + "size": 42952, + "type": "image/jpeg", + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/4.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/4.jpg", + "alt": "4.jpg" + }, + { + "size": 69255, + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/5.jpg", + "updated": "2021-03-26T19:42:06.833Z", + "timeCreated": "2021-03-26T19:42:06.833Z", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F5.jpg?alt=media&token=7cca786a-7d47-43bb-900b-b8d101c276b4", + "name": "5.jpg", + "contentType": "image/jpeg", + "type": "image/jpeg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/5.jpg", + "alt": "5.jpg" + } + ], + "_animationKey": "unique3" + }, + { + "text": "Now with the file we can choose the width we want to carve/cut and then we go to cut and start the wizzard:\n- We check that the sheet is fixed.\n- We also specify the cutting bit, we are using a 1/8 flat flute bit. \n- We tell the machine where the coordinate 0-0 is, which we always choose as the down left corner.\n- We raise the bit, turn on the Router!!!\n\nAND PUM THE MAGIC BEGINS!!", + "title": "Follow the cutting Wizzard", + "images": [ + { + "timeCreated": "2021-03-26T19:42:07.493Z", + "size": 72226, + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/6.jpg", + "updated": "2021-03-26T19:42:07.493Z", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F6.jpg?alt=media&token=ba7195dd-7771-435f-a188-057457697332", + "contentType": "image/jpeg", + "type": "image/jpeg", + "name": "6.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/6.jpg", + "alt": "6.jpg" + }, + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/7.jpg", + "size": 52424, + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F7.jpg?alt=media&token=a3d5820c-cfe2-484e-8f76-f861ab8b756d", + "contentType": "image/jpeg", + "type": "image/jpeg", + "timeCreated": "2021-03-26T19:42:07.308Z", + "updated": "2021-03-26T19:42:07.308Z", + "name": "7.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/7.jpg", + "alt": "7.jpg" + }, + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/8.jpg", + "name": "8.jpg", + "type": "image/jpeg", + "timeCreated": "2021-03-26T19:42:07.346Z", + "size": 55264, + "contentType": "image/jpeg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F8.jpg?alt=media&token=1c9816d7-3a99-4f41-8d3c-acc2670240f6", + "updated": "2021-03-26T19:42:07.346Z", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/8.jpg", + "alt": "8.jpg" + } + ], + "_animationKey": "uniquenisc2v" + }, + { + "text": "You take now your glasses or object and postprocess them and of course show it to your friends, family and so on.\n\n\n", + "images": [ + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/9.jpg", + "contentType": "image/jpeg", + "timeCreated": "2021-03-26T19:42:08.147Z", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F9.jpg?alt=media&token=4dcfe37d-e1ad-41e5-a590-40b4c37c5e1a", + "name": "9.jpg", + "updated": "2021-03-26T19:42:08.147Z", + "type": "image/jpeg", + "size": 82214, + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/9.jpg", + "alt": "9.jpg" + } + ], + "_animationKey": "uniquesgl34", + "title": "Post-production and show case" + }, + { + "_animationKey": "uniquem4y0yi", + "title": "Hack it and try it yourself", + "text": "You can try this project with other types of CNC machines, even manual Routers or manual saw, as I did on this video: https://youtu.be/gxkcffQD3eQ, but the important thing is that you share what you do and help this community to grow!!!\n\nShare your ideas and comments!", + "images": [ + { + "contentType": "image/jpeg", + "timeCreated": "2021-04-05T15:09:01.445Z", + "fullPath": "uploads/howtos/038gjWgLjiyYknbEjDeI/IMG_20200605_142311.jpg", + "type": "image/jpeg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2F038gjWgLjiyYknbEjDeI%2FIMG_20200605_142311.jpg?alt=media&token=f94152ff-f923-4054-a3ad-d8ec588856fa", + "size": 124661, + "updated": "2021-04-05T15:09:01.445Z", + "name": "IMG_20200605_142311.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/IMG_20200605_142311.jpg", + "alt": "IMG_20200605_142311.jpg" + } + ] + } + ], + "moderation": "accepted", + "user": { + "_modified": "2024-01-08T13:28:33.484Z", + "_id": "gus-merckel", + "subType": "mix", + "moderation": "accepted", + "_deleted": false, + "verified": false, + "type": "workspace", + "location": { + "lat": 19.3935, + "lng": -99.1656 + }, + "_created": "2024-01-08T13:28:33.484Z", + "geo": { + "latitude": 19.3935, + "lookupSource": "coordinates", + "longitude": -99.1656, + "localityLanguageRequested": "en", + "continent": "North America", + "continentCode": "NA", + "countryName": "Mexico", + "countryCode": "MX", + "principalSubdivision": "Ciudad de Mexico", + "principalSubdivisionCode": "MX-CMX", + "city": "Mexico City", + "locality": "Benito Juarez", + "postcode": "03103", + "plusCode": "76F29RVM+CQ", + "localityInfo": { + "administrative": [ + { + "name": "Mexico", + "description": "country in North America", + "isoName": "Mexico", + "order": 2, + "adminLevel": 2, + "isoCode": "MX", + "wikidataId": "Q96", + "geonameId": 3996063 + }, + { + "name": "Mexico City", + "description": "capital and largest city of Mexico", + "order": 5, + "adminLevel": 4, + "wikidataId": "Q1489", + "geonameId": 3530597 + }, + { + "name": "Ciudad de Mexico", + "description": "capital and largest city of Mexico", + "isoName": "Ciudad de Mexico", + "order": 6, + "adminLevel": 4, + "isoCode": "MX-CMX", + "wikidataId": "Q1489", + "geonameId": 3527646 + }, + { + "name": "Benito Juarez", + "description": "territorial demarcation of the Mexico City in Mexico", + "order": 7, + "adminLevel": 6, + "wikidataId": "Q2356998", + "geonameId": 3827406 + } + ], + "informative": [ + { + "name": "North America", + "description": "continent and northern subcontinent of the Americas", + "isoName": "North America", + "order": 1, + "isoCode": "NA", + "wikidataId": "Q49", + "geonameId": 6255149 + }, + { + "name": "America/Mexico_City", + "description": "time zone", + "order": 3 + }, + { + "name": "Greater Mexico City", + "description": "geographical object", + "order": 4, + "wikidataId": "Q665894" + }, + { + "name": "03103", + "description": "postal code", + "order": 8 + } + ] + } + }, + "data": { + "urls": [ + { + "name": "Email", + "url": "mailto:gustavomerckel@gmail.com" + }, + { + "name": "Facebook", + "url": "https://www.facebook.com/pl%c3%a1stico-chido-110888520718193" + }, + { + "name": "sponsor the work", + "url": "https://www.patreon.com/one_army" + } + ], + "description": "Plástico Chido builds and modifies the PP machines, and also experiments with CNC and Laser Cut", + "services": [ + { + "welding": false, + "assembling": false, + "machining": false, + "electronics": false, + "molds": false + } + ], + "title": "Plástico Chido", + "images": [] + }, + "detail": { + "services": [], + "urls": [] + } + }, + "category": { + "label": "uncategorized" + } +} \ No newline at end of file diff --git a/src/components/howtos/todos.md b/src/components/howtos/todos.md index b799636..3f9ab70 100644 --- a/src/components/howtos/todos.md +++ b/src/components/howtos/todos.md @@ -2,8 +2,13 @@ - for Astro, tailwind - no react or additional dependencies -- IHowto: import { IHowto } from "@/model/howto.js" -- For text, use {text} (import { i18n as Translate } from "@polymech/astro-base") -- data is provided via `import { getCollection } from 'astro:content', eg: const items = await getCollection('howtos')` -- [ ] update Detail.astro : improve layout and css +## Todos + +Detail.astro + +- [ ] when rendering howto.steps, apply a list of filters (some are async) + - [ ] replace all crlf with html line breaks + - [ ] render links via
+ - [ ] let me transform or reject links (black list) + - [ ] let me filter certain step descriptions for certain words/phrases diff --git a/src/components/howtos/todos.sh b/src/components/howtos/todos.sh index 4c20053..4b0a839 100644 --- a/src/components/howtos/todos.sh +++ b/src/components/howtos/todos.sh @@ -1,12 +1,9 @@ kbotd --preferences ./todos.md \ - --include=./howto.ts \ --include=./Detail.astro \ - --include=./howto.json \ + --include=./howto_sample.json \ --disable=terminal,git,npm,user,interact,search,email,web \ --disableTools=read_file,read_files,list_files,file_exists,web \ --model=gpt-4.5-preview \ --router=openai \ --mode=completion \ --dst=./Detail2.astro - - diff --git a/src/model/howto.sh b/src/model/howto.sh index 0f797d6..b05c4a8 100644 --- a/src/model/howto.sh +++ b/src/model/howto.sh @@ -1,7 +1,6 @@ -kbotd --preferences ./todos-howto.md \ +kbotd --preferences ./todos.md \ --include=./howto.ts \ - --include=./howto.json \ + --include=./howto_sample.json \ --disable=terminal,git,npm,user,interact,search,email,web \ --disableTools=read_file,read_files,list_files,file_exists,web \ --model=anthropic/claude-3.7-sonnet - diff --git a/src/model/howto.ts b/src/model/howto.ts index 00905a6..1913ef5 100644 --- a/src/model/howto.ts +++ b/src/model/howto.ts @@ -76,20 +76,13 @@ export const howtos = async () => { let howtos = data.v3_howtos as any[] howtos = howtos.filter((h) => h.moderation == 'accepted'); const tags = data.v3_tags; - let output = { - tags: {}, - howtows: {} - } + howtos.forEach((howto: IHowto) => { const howtoTags: any = []; for (const ht in howto.tags) { const gt: any = tags.find((t) => t._id === ht) || { label: 'untagged' }; if (gt) { howtoTags.push(gt.label || ""); - if (!output.tags[gt.label]) { - output.tags[gt.label] = [] - } - output.tags[gt.label].push(howto.slug.trim()); } } howto.user = data.v3_mappins.find((u) => u._id == howto._createdBy); @@ -253,7 +246,6 @@ export interface IHowto { difficulty_level: string _id: string tags?: Tags - user: any total_views: number _contentModifiedTimestamp: string cover_image: Image @@ -261,6 +253,7 @@ export interface IHowto { moderatorFeedback: string steps: Step[] moderation: string + user?: User } export interface Tags { @@ -315,4 +308,95 @@ export interface IOATag { _createdBy: string _modified: string _id: string -} \ No newline at end of file +} + +export interface User +{ + _modified: string + _id: string + subType: string + moderation: string + _deleted: boolean + verified: boolean + type: string + location: Location + _created: string + geo: Geo + data: Data + detail: Detail +} + +export interface Location { + lat: number + lng: number +} + +export interface Geo { + latitude: number + lookupSource: string + longitude: number + localityLanguageRequested: string + continent: string + continentCode: string + countryName: string + countryCode: string + principalSubdivision: string + principalSubdivisionCode: string + city: string + locality: string + postcode: string + plusCode: string + localityInfo: LocalityInfo +} + +export interface LocalityInfo { + administrative: Administrative[] + informative: Informative[] +} + +export interface Administrative { + name: string + description: string + isoName?: string + order: number + adminLevel: number + isoCode?: string + wikidataId: string + geonameId: number +} + +export interface Informative { + name: string + description: string + isoName?: string + order: number + isoCode?: string + wikidataId?: string + geonameId?: number +} + +export interface Data { + urls: Url[] + description: string + services: Service[] + title: string + images: any[] +} + +export interface Url { + name: string + url: string +} + +export interface Service { + welding: boolean + assembling: boolean + machining: boolean + electronics: boolean + molds: boolean +} + +export interface Detail { + services: any[] + urls: any[] +} diff --git a/src/model/howto_sample.js b/src/model/howto_sample.js new file mode 100644 index 0000000..edd4baa --- /dev/null +++ b/src/model/howto_sample.js @@ -0,0 +1,339 @@ +{ + "_createdBy": "gus-merckel", + "mentions": [], + "_deleted": false, + "fileLink": "", + "slug": "cut-out-shapes-out-of-plastic-sheets-with-a-cnc-", + "_modified": "2023-10-27T18:09:36.519Z", + "previousSlugs": [ + "cut-out-shapes-out-of-plastic-sheets-with-a-cnc-" + ], + "_created": "2023-08-23T18:20:09.098Z", + "description": "In this how to, I will show you our process to cut HDPE Sheets using a X-Carve CNC.\n\nHere is the full video in spanish with subtitles https://www.youtube.com/watch?v=4LrrFz802To ", + "votedUsefulBy": [ + "sigolene", + "mattia", + "uillinoispreciousplastics" + ], + "creatorCountry": "mx", + "total_downloads": 0, + "title": "Cut out shapes out of plastic sheets with a CNC ", + "time": "< 5 hours", + "files": [], + "difficulty_level": "Medium", + "_id": "038gjWgLjiyYknbEjDeI", + "tags": [ + "HDPE" + ], + "total_views": 232, + "_contentModifiedTimestamp": "2023-08-23T18:20:09.098Z", + "cover_image": { + "name": "IMG_20200605_142311.jpg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2F038gjWgLjiyYknbEjDeI%2FIMG_20200605_142311.jpg?alt=media&token=c272c174-1adc-45af-967b-771adce7295d", + "type": "image/jpeg", + "fullPath": "uploads/howtos/038gjWgLjiyYknbEjDeI/IMG_20200605_142311.jpg", + "updated": "2021-04-05T15:09:00.605Z", + "size": 124661, + "timeCreated": "2021-04-05T15:09:00.605Z", + "contentType": "image/jpeg" + }, + "comments": [], + "moderatorFeedback": "", + "steps": [ + { + "title": "Measure the plastic sheet", + "text": "For this step we need to measure our plastic sheet: Height, Width and Thickness. Our X-Carve machine works with the CAM Software EASEL, for me, the easiest software for CNC milling out there. \n\nThe cool thing about Easel (https://easel.inventables.com/) is that you can \"simulate\" your actual material and THEY EVEN HAVE HDPE 2-Colors in their cutting material lists!!\n\n\n", + "images": [ + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/1.jpg", + "name": "1.jpg", + "size": 74095, + "type": "image/jpeg", + "timeCreated": "2021-03-26T19:42:05.766Z", + "contentType": "image/jpeg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F1.jpg?alt=media&token=293d733d-05a5-494a-9340-47f4564f1939", + "updated": "2021-03-26T19:42:05.766Z", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/1.jpg", + "alt": "1.jpg" + }, + { + "contentType": "image/jpeg", + "timeCreated": "2021-03-26T19:42:05.669Z", + "updated": "2021-03-26T19:42:05.669Z", + "size": 69665, + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F2.jpg?alt=media&token=004f50f1-97ac-4df4-9ba9-f463aa4cbca3", + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/2.jpg", + "name": "2.jpg", + "type": "image/jpeg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/2.jpg", + "alt": "2.jpg" + } + ], + "_animationKey": "unique1" + }, + { + "text": "Using the CNC clamps from the X-Carve, secure the sheet to the table, ", + "_animationKey": "unique2", + "images": [ + { + "updated": "2021-03-26T19:42:06.249Z", + "size": 55544, + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/3.jpg", + "timeCreated": "2021-03-26T19:42:06.249Z", + "name": "3.jpg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F3.jpg?alt=media&token=0b9c1914-1c75-429e-b34a-1e2b3706edef", + "contentType": "image/jpeg", + "type": "image/jpeg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/3.jpg", + "alt": "3.jpg" + } + ], + "title": "Secure sheet " + }, + { + "title": "Choosing a file to cut ", + "text": "Now we go to our illustrator, such as Inkscape to design a vector file or download and open source one frome https://thenounproject.com/.\n\nWe download the SVG file, which is an open source vector format and import it to Easel. \n", + "images": [ + { + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F4.jpg?alt=media&token=1cd2d49d-9335-4bb1-ac2a-e625322ca604", + "contentType": "image/jpeg", + "timeCreated": "2021-03-26T19:42:06.727Z", + "updated": "2021-03-26T19:42:06.727Z", + "name": "4.jpg", + "size": 42952, + "type": "image/jpeg", + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/4.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/4.jpg", + "alt": "4.jpg" + }, + { + "size": 69255, + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/5.jpg", + "updated": "2021-03-26T19:42:06.833Z", + "timeCreated": "2021-03-26T19:42:06.833Z", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F5.jpg?alt=media&token=7cca786a-7d47-43bb-900b-b8d101c276b4", + "name": "5.jpg", + "contentType": "image/jpeg", + "type": "image/jpeg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/5.jpg", + "alt": "5.jpg" + } + ], + "_animationKey": "unique3" + }, + { + "text": "Now with the file we can choose the width we want to carve/cut and then we go to cut and start the wizzard:\n- We check that the sheet is fixed.\n- We also specify the cutting bit, we are using a 1/8 flat flute bit. \n- We tell the machine where the coordinate 0-0 is, which we always choose as the down left corner.\n- We raise the bit, turn on the Router!!!\n\nAND PUM THE MAGIC BEGINS!!", + "title": "Follow the cutting Wizzard", + "images": [ + { + "timeCreated": "2021-03-26T19:42:07.493Z", + "size": 72226, + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/6.jpg", + "updated": "2021-03-26T19:42:07.493Z", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F6.jpg?alt=media&token=ba7195dd-7771-435f-a188-057457697332", + "contentType": "image/jpeg", + "type": "image/jpeg", + "name": "6.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/6.jpg", + "alt": "6.jpg" + }, + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/7.jpg", + "size": 52424, + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F7.jpg?alt=media&token=a3d5820c-cfe2-484e-8f76-f861ab8b756d", + "contentType": "image/jpeg", + "type": "image/jpeg", + "timeCreated": "2021-03-26T19:42:07.308Z", + "updated": "2021-03-26T19:42:07.308Z", + "name": "7.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/7.jpg", + "alt": "7.jpg" + }, + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/8.jpg", + "name": "8.jpg", + "type": "image/jpeg", + "timeCreated": "2021-03-26T19:42:07.346Z", + "size": 55264, + "contentType": "image/jpeg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F8.jpg?alt=media&token=1c9816d7-3a99-4f41-8d3c-acc2670240f6", + "updated": "2021-03-26T19:42:07.346Z", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/8.jpg", + "alt": "8.jpg" + } + ], + "_animationKey": "uniquenisc2v" + }, + { + "text": "You take now your glasses or object and postprocess them and of course show it to your friends, family and so on.\n\n\n", + "images": [ + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/9.jpg", + "contentType": "image/jpeg", + "timeCreated": "2021-03-26T19:42:08.147Z", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F9.jpg?alt=media&token=4dcfe37d-e1ad-41e5-a590-40b4c37c5e1a", + "name": "9.jpg", + "updated": "2021-03-26T19:42:08.147Z", + "type": "image/jpeg", + "size": 82214, + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/9.jpg", + "alt": "9.jpg" + } + ], + "_animationKey": "uniquesgl34", + "title": "Post-production and show case" + }, + { + "_animationKey": "uniquem4y0yi", + "title": "Hack it and try it yourself", + "text": "You can try this project with other types of CNC machines, even manual Routers or manual saw, as I did on this video: https://youtu.be/gxkcffQD3eQ, but the important thing is that you share what you do and help this community to grow!!!\n\nShare your ideas and comments!", + "images": [ + { + "contentType": "image/jpeg", + "timeCreated": "2021-04-05T15:09:01.445Z", + "fullPath": "uploads/howtos/038gjWgLjiyYknbEjDeI/IMG_20200605_142311.jpg", + "type": "image/jpeg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2F038gjWgLjiyYknbEjDeI%2FIMG_20200605_142311.jpg?alt=media&token=f94152ff-f923-4054-a3ad-d8ec588856fa", + "size": 124661, + "updated": "2021-04-05T15:09:01.445Z", + "name": "IMG_20200605_142311.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/IMG_20200605_142311.jpg", + "alt": "IMG_20200605_142311.jpg" + } + ] + } + ], + "moderation": "accepted", + "user": { + "_modified": "2024-01-08T13:28:33.484Z", + "_id": "gus-merckel", + "subType": "mix", + "moderation": "accepted", + "_deleted": false, + "verified": false, + "type": "workspace", + "location": { + "lat": 19.3935, + "lng": -99.1656 + }, + "_created": "2024-01-08T13:28:33.484Z", + "geo": { + "latitude": 19.3935, + "lookupSource": "coordinates", + "longitude": -99.1656, + "localityLanguageRequested": "en", + "continent": "North America", + "continentCode": "NA", + "countryName": "Mexico", + "countryCode": "MX", + "principalSubdivision": "Ciudad de Mexico", + "principalSubdivisionCode": "MX-CMX", + "city": "Mexico City", + "locality": "Benito Juarez", + "postcode": "03103", + "plusCode": "76F29RVM+CQ", + "localityInfo": { + "administrative": [ + { + "name": "Mexico", + "description": "country in North America", + "isoName": "Mexico", + "order": 2, + "adminLevel": 2, + "isoCode": "MX", + "wikidataId": "Q96", + "geonameId": 3996063 + }, + { + "name": "Mexico City", + "description": "capital and largest city of Mexico", + "order": 5, + "adminLevel": 4, + "wikidataId": "Q1489", + "geonameId": 3530597 + }, + { + "name": "Ciudad de Mexico", + "description": "capital and largest city of Mexico", + "isoName": "Ciudad de Mexico", + "order": 6, + "adminLevel": 4, + "isoCode": "MX-CMX", + "wikidataId": "Q1489", + "geonameId": 3527646 + }, + { + "name": "Benito Juarez", + "description": "territorial demarcation of the Mexico City in Mexico", + "order": 7, + "adminLevel": 6, + "wikidataId": "Q2356998", + "geonameId": 3827406 + } + ], + "informative": [ + { + "name": "North America", + "description": "continent and northern subcontinent of the Americas", + "isoName": "North America", + "order": 1, + "isoCode": "NA", + "wikidataId": "Q49", + "geonameId": 6255149 + }, + { + "name": "America/Mexico_City", + "description": "time zone", + "order": 3 + }, + { + "name": "Greater Mexico City", + "description": "geographical object", + "order": 4, + "wikidataId": "Q665894" + }, + { + "name": "03103", + "description": "postal code", + "order": 8 + } + ] + } + }, + "data": { + "urls": [ + { + "name": "Email", + "url": "mailto:gustavomerckel@gmail.com" + }, + { + "name": "Facebook", + "url": "https://www.facebook.com/pl%c3%a1stico-chido-110888520718193" + }, + { + "name": "sponsor the work", + "url": "https://www.patreon.com/one_army" + } + ], + "description": "Plástico Chido builds and modifies the PP machines, and also experiments with CNC and Laser Cut", + "services": [ + { + "welding": false, + "assembling": false, + "machining": false, + "electronics": false, + "molds": false + } + ], + "title": "Plástico Chido", + "images": [] + }, + "detail": { + "services": [], + "urls": [] + } + }, + "category": { + "label": "uncategorized" + } +} \ No newline at end of file diff --git a/src/model/howto_sample.json b/src/model/howto_sample.json new file mode 100644 index 0000000..edd4baa --- /dev/null +++ b/src/model/howto_sample.json @@ -0,0 +1,339 @@ +{ + "_createdBy": "gus-merckel", + "mentions": [], + "_deleted": false, + "fileLink": "", + "slug": "cut-out-shapes-out-of-plastic-sheets-with-a-cnc-", + "_modified": "2023-10-27T18:09:36.519Z", + "previousSlugs": [ + "cut-out-shapes-out-of-plastic-sheets-with-a-cnc-" + ], + "_created": "2023-08-23T18:20:09.098Z", + "description": "In this how to, I will show you our process to cut HDPE Sheets using a X-Carve CNC.\n\nHere is the full video in spanish with subtitles https://www.youtube.com/watch?v=4LrrFz802To ", + "votedUsefulBy": [ + "sigolene", + "mattia", + "uillinoispreciousplastics" + ], + "creatorCountry": "mx", + "total_downloads": 0, + "title": "Cut out shapes out of plastic sheets with a CNC ", + "time": "< 5 hours", + "files": [], + "difficulty_level": "Medium", + "_id": "038gjWgLjiyYknbEjDeI", + "tags": [ + "HDPE" + ], + "total_views": 232, + "_contentModifiedTimestamp": "2023-08-23T18:20:09.098Z", + "cover_image": { + "name": "IMG_20200605_142311.jpg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2F038gjWgLjiyYknbEjDeI%2FIMG_20200605_142311.jpg?alt=media&token=c272c174-1adc-45af-967b-771adce7295d", + "type": "image/jpeg", + "fullPath": "uploads/howtos/038gjWgLjiyYknbEjDeI/IMG_20200605_142311.jpg", + "updated": "2021-04-05T15:09:00.605Z", + "size": 124661, + "timeCreated": "2021-04-05T15:09:00.605Z", + "contentType": "image/jpeg" + }, + "comments": [], + "moderatorFeedback": "", + "steps": [ + { + "title": "Measure the plastic sheet", + "text": "For this step we need to measure our plastic sheet: Height, Width and Thickness. Our X-Carve machine works with the CAM Software EASEL, for me, the easiest software for CNC milling out there. \n\nThe cool thing about Easel (https://easel.inventables.com/) is that you can \"simulate\" your actual material and THEY EVEN HAVE HDPE 2-Colors in their cutting material lists!!\n\n\n", + "images": [ + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/1.jpg", + "name": "1.jpg", + "size": 74095, + "type": "image/jpeg", + "timeCreated": "2021-03-26T19:42:05.766Z", + "contentType": "image/jpeg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F1.jpg?alt=media&token=293d733d-05a5-494a-9340-47f4564f1939", + "updated": "2021-03-26T19:42:05.766Z", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/1.jpg", + "alt": "1.jpg" + }, + { + "contentType": "image/jpeg", + "timeCreated": "2021-03-26T19:42:05.669Z", + "updated": "2021-03-26T19:42:05.669Z", + "size": 69665, + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F2.jpg?alt=media&token=004f50f1-97ac-4df4-9ba9-f463aa4cbca3", + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/2.jpg", + "name": "2.jpg", + "type": "image/jpeg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/2.jpg", + "alt": "2.jpg" + } + ], + "_animationKey": "unique1" + }, + { + "text": "Using the CNC clamps from the X-Carve, secure the sheet to the table, ", + "_animationKey": "unique2", + "images": [ + { + "updated": "2021-03-26T19:42:06.249Z", + "size": 55544, + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/3.jpg", + "timeCreated": "2021-03-26T19:42:06.249Z", + "name": "3.jpg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F3.jpg?alt=media&token=0b9c1914-1c75-429e-b34a-1e2b3706edef", + "contentType": "image/jpeg", + "type": "image/jpeg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/3.jpg", + "alt": "3.jpg" + } + ], + "title": "Secure sheet " + }, + { + "title": "Choosing a file to cut ", + "text": "Now we go to our illustrator, such as Inkscape to design a vector file or download and open source one frome https://thenounproject.com/.\n\nWe download the SVG file, which is an open source vector format and import it to Easel. \n", + "images": [ + { + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F4.jpg?alt=media&token=1cd2d49d-9335-4bb1-ac2a-e625322ca604", + "contentType": "image/jpeg", + "timeCreated": "2021-03-26T19:42:06.727Z", + "updated": "2021-03-26T19:42:06.727Z", + "name": "4.jpg", + "size": 42952, + "type": "image/jpeg", + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/4.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/4.jpg", + "alt": "4.jpg" + }, + { + "size": 69255, + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/5.jpg", + "updated": "2021-03-26T19:42:06.833Z", + "timeCreated": "2021-03-26T19:42:06.833Z", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F5.jpg?alt=media&token=7cca786a-7d47-43bb-900b-b8d101c276b4", + "name": "5.jpg", + "contentType": "image/jpeg", + "type": "image/jpeg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/5.jpg", + "alt": "5.jpg" + } + ], + "_animationKey": "unique3" + }, + { + "text": "Now with the file we can choose the width we want to carve/cut and then we go to cut and start the wizzard:\n- We check that the sheet is fixed.\n- We also specify the cutting bit, we are using a 1/8 flat flute bit. \n- We tell the machine where the coordinate 0-0 is, which we always choose as the down left corner.\n- We raise the bit, turn on the Router!!!\n\nAND PUM THE MAGIC BEGINS!!", + "title": "Follow the cutting Wizzard", + "images": [ + { + "timeCreated": "2021-03-26T19:42:07.493Z", + "size": 72226, + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/6.jpg", + "updated": "2021-03-26T19:42:07.493Z", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F6.jpg?alt=media&token=ba7195dd-7771-435f-a188-057457697332", + "contentType": "image/jpeg", + "type": "image/jpeg", + "name": "6.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/6.jpg", + "alt": "6.jpg" + }, + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/7.jpg", + "size": 52424, + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F7.jpg?alt=media&token=a3d5820c-cfe2-484e-8f76-f861ab8b756d", + "contentType": "image/jpeg", + "type": "image/jpeg", + "timeCreated": "2021-03-26T19:42:07.308Z", + "updated": "2021-03-26T19:42:07.308Z", + "name": "7.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/7.jpg", + "alt": "7.jpg" + }, + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/8.jpg", + "name": "8.jpg", + "type": "image/jpeg", + "timeCreated": "2021-03-26T19:42:07.346Z", + "size": 55264, + "contentType": "image/jpeg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F8.jpg?alt=media&token=1c9816d7-3a99-4f41-8d3c-acc2670240f6", + "updated": "2021-03-26T19:42:07.346Z", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/8.jpg", + "alt": "8.jpg" + } + ], + "_animationKey": "uniquenisc2v" + }, + { + "text": "You take now your glasses or object and postprocess them and of course show it to your friends, family and so on.\n\n\n", + "images": [ + { + "fullPath": "uploads/howtos/pbo0Pe44aTngvlD04kGf/9.jpg", + "contentType": "image/jpeg", + "timeCreated": "2021-03-26T19:42:08.147Z", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2Fpbo0Pe44aTngvlD04kGf%2F9.jpg?alt=media&token=4dcfe37d-e1ad-41e5-a590-40b4c37c5e1a", + "name": "9.jpg", + "updated": "2021-03-26T19:42:08.147Z", + "type": "image/jpeg", + "size": 82214, + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/9.jpg", + "alt": "9.jpg" + } + ], + "_animationKey": "uniquesgl34", + "title": "Post-production and show case" + }, + { + "_animationKey": "uniquem4y0yi", + "title": "Hack it and try it yourself", + "text": "You can try this project with other types of CNC machines, even manual Routers or manual saw, as I did on this video: https://youtu.be/gxkcffQD3eQ, but the important thing is that you share what you do and help this community to grow!!!\n\nShare your ideas and comments!", + "images": [ + { + "contentType": "image/jpeg", + "timeCreated": "2021-04-05T15:09:01.445Z", + "fullPath": "uploads/howtos/038gjWgLjiyYknbEjDeI/IMG_20200605_142311.jpg", + "type": "image/jpeg", + "downloadUrl": "https://firebasestorage.googleapis.com/v0/b/onearmyworld.appspot.com/o/uploads%2Fhowtos%2F038gjWgLjiyYknbEjDeI%2FIMG_20200605_142311.jpg?alt=media&token=f94152ff-f923-4054-a3ad-d8ec588856fa", + "size": 124661, + "updated": "2021-04-05T15:09:01.445Z", + "name": "IMG_20200605_142311.jpg", + "src": "/resources/howtos/cut-out-shapes-out-of-plastic-sheets-with-a-cnc-/IMG_20200605_142311.jpg", + "alt": "IMG_20200605_142311.jpg" + } + ] + } + ], + "moderation": "accepted", + "user": { + "_modified": "2024-01-08T13:28:33.484Z", + "_id": "gus-merckel", + "subType": "mix", + "moderation": "accepted", + "_deleted": false, + "verified": false, + "type": "workspace", + "location": { + "lat": 19.3935, + "lng": -99.1656 + }, + "_created": "2024-01-08T13:28:33.484Z", + "geo": { + "latitude": 19.3935, + "lookupSource": "coordinates", + "longitude": -99.1656, + "localityLanguageRequested": "en", + "continent": "North America", + "continentCode": "NA", + "countryName": "Mexico", + "countryCode": "MX", + "principalSubdivision": "Ciudad de Mexico", + "principalSubdivisionCode": "MX-CMX", + "city": "Mexico City", + "locality": "Benito Juarez", + "postcode": "03103", + "plusCode": "76F29RVM+CQ", + "localityInfo": { + "administrative": [ + { + "name": "Mexico", + "description": "country in North America", + "isoName": "Mexico", + "order": 2, + "adminLevel": 2, + "isoCode": "MX", + "wikidataId": "Q96", + "geonameId": 3996063 + }, + { + "name": "Mexico City", + "description": "capital and largest city of Mexico", + "order": 5, + "adminLevel": 4, + "wikidataId": "Q1489", + "geonameId": 3530597 + }, + { + "name": "Ciudad de Mexico", + "description": "capital and largest city of Mexico", + "isoName": "Ciudad de Mexico", + "order": 6, + "adminLevel": 4, + "isoCode": "MX-CMX", + "wikidataId": "Q1489", + "geonameId": 3527646 + }, + { + "name": "Benito Juarez", + "description": "territorial demarcation of the Mexico City in Mexico", + "order": 7, + "adminLevel": 6, + "wikidataId": "Q2356998", + "geonameId": 3827406 + } + ], + "informative": [ + { + "name": "North America", + "description": "continent and northern subcontinent of the Americas", + "isoName": "North America", + "order": 1, + "isoCode": "NA", + "wikidataId": "Q49", + "geonameId": 6255149 + }, + { + "name": "America/Mexico_City", + "description": "time zone", + "order": 3 + }, + { + "name": "Greater Mexico City", + "description": "geographical object", + "order": 4, + "wikidataId": "Q665894" + }, + { + "name": "03103", + "description": "postal code", + "order": 8 + } + ] + } + }, + "data": { + "urls": [ + { + "name": "Email", + "url": "mailto:gustavomerckel@gmail.com" + }, + { + "name": "Facebook", + "url": "https://www.facebook.com/pl%c3%a1stico-chido-110888520718193" + }, + { + "name": "sponsor the work", + "url": "https://www.patreon.com/one_army" + } + ], + "description": "Plástico Chido builds and modifies the PP machines, and also experiments with CNC and Laser Cut", + "services": [ + { + "welding": false, + "assembling": false, + "machining": false, + "electronics": false, + "molds": false + } + ], + "title": "Plástico Chido", + "images": [] + }, + "detail": { + "services": [], + "urls": [] + } + }, + "category": { + "label": "uncategorized" + } +} \ No newline at end of file diff --git a/src/model/todos-howto.md b/src/model/todos-howto.md deleted file mode 100644 index ab46945..0000000 --- a/src/model/todos-howto.md +++ /dev/null @@ -1,47 +0,0 @@ -## Todos - -- for Astro, tailwind -- no react or additional dependencies -- IHowto: import { IHowto } from "@/model/howto.js" -- For text, use {text} (import { i18n as Translate } from "@polymech/astro-base") -- data is provided via `import { getCollection } from 'astro:content' -const items = await getCollection('howtos')` - -### Example Tailwind Sidebar - - - - - -## Todos - -- [ ] create minimal Astro component, a sidebar using flowbit (see example) for the given interface ("IHowto") and sample data ../components/libary/howto.astro, use the 'category' field, save as ../components/howtos/sidebar2.astro diff --git a/src/model/todos.md b/src/model/todos.md new file mode 100644 index 0000000..3f9ab70 --- /dev/null +++ b/src/model/todos.md @@ -0,0 +1,14 @@ +## Todos + +- for Astro, tailwind +- no react or additional dependencies + +## Todos + +Detail.astro + +- [ ] when rendering howto.steps, apply a list of filters (some are async) + - [ ] replace all crlf with html line breaks + - [ ] render links via + - [ ] let me transform or reject links (black list) + - [ ] let me filter certain step descriptions for certain words/phrases diff --git a/src/pages/[locale]/howtos/[...path].astro b/src/pages/[locale]/howtos/[...path].astro index 374f409..098ab9e 100644 --- a/src/pages/[locale]/howtos/[...path].astro +++ b/src/pages/[locale]/howtos/[...path].astro @@ -1,5 +1,5 @@ --- -import Layout from '@/components/howtos/Detail.astro' +import Layout from '@/components/howtos/Detail2.astro' import { getCollection } from 'astro:content' import { LANGUAGES_PROD as LANGUAGES } from "config/config.js"