diff --git a/astro.config.mjs b/astro.config.mjs index fb0131d..01dd22b 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,12 +1,10 @@ import { defineConfig } from 'astro/config'; import tailwind from '@astrojs/tailwind'; -import vercel from '@astrojs/vercel'; import sitemap from '@astrojs/sitemap'; export default defineConfig({ site: 'https://fav.jpdiaz.dev', - output: 'server', // Puedes cambiar a "static" si no usas SSR - adapter: vercel(), + output: 'static', // Changed from 'server' to prevent excessive serverless function calls integrations: [ tailwind(), sitemap({ diff --git a/package-lock.json b/package-lock.json index 9b2af5a..bca3cdf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,9 +37,9 @@ } }, "node_modules/@astrojs/compiler": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.12.0.tgz", - "integrity": "sha512-7bCjW6tVDpUurQLeKBUN9tZ5kSv5qYrGmcn0sG0IwacL7isR2ZbyyA3AdZ4uxsuUFOS2SlgReTH7wkxO6zpqWA==", + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.12.2.tgz", + "integrity": "sha512-w2zfvhjNCkNMmMMOn5b0J8+OmUaBL1o40ipMvqcG6NRpdC+lKxmTi48DT8Xw0SzJ3AfmeFLB45zXZXtmbsjcgw==", "license": "MIT" }, "node_modules/@astrojs/internal-helpers": { @@ -240,9 +240,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20250525.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250525.0.tgz", - "integrity": "sha512-L5l+7sSJJT2+riR5rS3Q3PKNNySPjWfRIeaNGMVRi1dPO6QPi4lwuxfRUFNoeUdilZJUVPfSZvTtj9RedsKznQ==", + "version": "1.20250604.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250604.0.tgz", + "integrity": "sha512-PI6AWAzhHg75KVhYkSWFBf3HKCHstpaKg4nrx6LYZaEvz0TaTz+JQpYU2fNAgGFmVsK5xEzwFTGh3DAVAKONPw==", "cpu": [ "x64" ], @@ -257,9 +257,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20250525.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250525.0.tgz", - "integrity": "sha512-Y3IbIdrF/vJWh/WBvshwcSyUh175VAiLRW7963S1dXChrZ1N5wuKGQm9xY69cIGVtitpMJWWW3jLq7J/Xxwm0Q==", + "version": "1.20250604.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250604.0.tgz", + "integrity": "sha512-hOiZZSop7QRQgGERtTIy9eU5GvPpIsgE2/BDsUdHMl7OBZ7QLniqvgDzLNDzj0aTkCldm9Yl/Z+C7aUgRdOccw==", "cpu": [ "arm64" ], @@ -274,9 +274,9 @@ } }, "node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20250525.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250525.0.tgz", - "integrity": "sha512-KSyQPAby+c6cpENoO0ayCQlY6QIh28l/+QID7VC1SLXfiNHy+hPNsH1vVBTST6CilHVAQSsy9tCZ9O9XECB8yg==", + "version": "1.20250604.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250604.0.tgz", + "integrity": "sha512-S0R9r7U4nv9qejYygQj01hArC4KUbQQ4u29rvegR0MGoXZY8AHIEuJxon0kE7r7aWFJxvl4W3tOH+5hwW51LYw==", "cpu": [ "x64" ], @@ -291,9 +291,9 @@ } }, "node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20250525.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250525.0.tgz", - "integrity": "sha512-Nt0FUxS2kQhJUea4hMCNPaetkrAFDhPnNX/ntwcqVlGgnGt75iaAhupWJbU0GB+gIWlKeuClUUnDZqKbicoKyg==", + "version": "1.20250604.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250604.0.tgz", + "integrity": "sha512-BTFU/rXpNy03wpeueI2P7q1vVjbg2V6mCyyFGqDqMn2gSVYXH1G0zFNolV13PQXa0HgaqM6oYnqtAxluqbA+kQ==", "cpu": [ "arm64" ], @@ -308,9 +308,9 @@ } }, "node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20250525.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250525.0.tgz", - "integrity": "sha512-mwTj+9f3uIa4NEXR1cOa82PjLa6dbrb3J+KCVJFYIaq7e63VxEzOchCXS4tublT2pmOhmFqkgBMXrxozxNkR2Q==", + "version": "1.20250604.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250604.0.tgz", + "integrity": "sha512-tW/U9/qDmDZBeoEVcK5skb2uouVAMXMzt7o/uGvaIFLeZsQkOp4NBmvoQQd+nbOc7nVCJIwFoSMokd89AhzCkA==", "cpu": [ "x64" ], @@ -1394,9 +1394,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.41.2.tgz", - "integrity": "sha512-YvIQXGGDzbOpkLuFcjGs+aiAi38D8FCyJanIdlcV2m9DWMJpHTSY8L9piO93VHBLRoe8O9C/FiycjnJ8+aP1tg==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.43.0.tgz", + "integrity": "sha512-Krjy9awJl6rKbruhQDgivNbD1WuLb8xAclM4IR4cN5pHGAs2oIMMQJEiC3IC/9TZJ+QZkmZhlMO/6MBGxPidpw==", "cpu": [ "arm" ], @@ -1407,9 +1407,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.41.2.tgz", - "integrity": "sha512-8AVWhLnN9FteevGP+9pj/Y79vqE9TdziZTe5XkN5Z9+9QY7TEBbr4iz2te8/vXbLSLEdmaQx+o2GWXrLXDKGPg==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.43.0.tgz", + "integrity": "sha512-ss4YJwRt5I63454Rpj+mXCXicakdFmKnUNxr1dLK+5rv5FJgAxnN7s31a5VchRYxCFWdmnDWKd0wbAdTr0J5EA==", "cpu": [ "arm64" ], @@ -1420,9 +1420,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.41.2.tgz", - "integrity": "sha512-w/idsvFiipvVGDcXKu1pdiIEnh9V63NPjpo5E48BbbrhUzEQthVXylKjYKj9lgX+89Ao36BxArkKPxxs7aXn3g==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.43.0.tgz", + "integrity": "sha512-eKoL8ykZ7zz8MjgBenEF2OoTNFAPFz1/lyJ5UmmFSz5jW+7XbH1+MAgCVHy72aG59rbuQLcJeiMrP8qP5d/N0A==", "cpu": [ "arm64" ], @@ -1433,9 +1433,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.41.2.tgz", - "integrity": "sha512-oNUD4Kywoild1lsuUu1jydg3+IdQbyg4JNZb1+3Voh/revkYxMqMl4a/sZw5z+BSgFbXK6rR0RGutnHO8QS53g==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.43.0.tgz", + "integrity": "sha512-SYwXJgaBYW33Wi/q4ubN+ldWC4DzQY62S4Ll2dgfr/dbPoF50dlQwEaEHSKrQdSjC6oIe1WgzosoaNoHCdNuMg==", "cpu": [ "x64" ], @@ -1446,9 +1446,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.41.2.tgz", - "integrity": "sha512-yKXgW9UF2f78/PaSAFgDJbrLB/aETxH98jJFIpqESLyhyRmEqZl1dqAoy0IigJJZdwP+ZJdLw2isKiwb1wAqcA==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.43.0.tgz", + "integrity": "sha512-SV+U5sSo0yujrjzBF7/YidieK2iF6E7MdF6EbYxNz94lA+R0wKl3SiixGyG/9Klab6uNBIqsN7j4Y/Fya7wAjQ==", "cpu": [ "arm64" ], @@ -1459,9 +1459,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.41.2.tgz", - "integrity": "sha512-ye4rQ80/fAIcUyIil7S/IzGpHvlPUoZvUQSq0OmU+LXb/I9E5Brh7PKJ/K0plsLCQx9Hx01526Uf4Iy8RqmLJw==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.43.0.tgz", + "integrity": "sha512-J7uCsiV13L/VOeHJBo5SjasKiGxJ0g+nQTrBkAsmQBIdil3KhPnSE9GnRon4ejX1XDdsmK/l30IYLiAaQEO0Cg==", "cpu": [ "x64" ], @@ -1472,9 +1472,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.41.2.tgz", - "integrity": "sha512-q2aqiDKNKNj9jG/6JIHakx1hmj6A8bxc3U6rpZjL8znx3O4OGpPJcyEiJSxmFd8olpjfRezh7PONU+3RTQmj0A==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.43.0.tgz", + "integrity": "sha512-gTJ/JnnjCMc15uwB10TTATBEhK9meBIY+gXP4s0sHD1zHOaIh4Dmy1X9wup18IiY9tTNk5gJc4yx9ctj/fjrIw==", "cpu": [ "arm" ], @@ -1485,9 +1485,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.41.2.tgz", - "integrity": "sha512-qDtvGRNcj2SCY+XFV24s6/vOV46fktFa3/AtedKLVJZdO/WGyOtDDq2zF7nNGhzJa0Tx7bvJ92z9PjjF7nKbBg==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.43.0.tgz", + "integrity": "sha512-ZJ3gZynL1LDSIvRfz0qXtTNs56n5DI2Mq+WACWZ7yGHFUEirHBRt7fyIk0NsCKhmRhn7WAcjgSkSVVxKlPNFFw==", "cpu": [ "arm" ], @@ -1498,9 +1498,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.41.2.tgz", - "integrity": "sha512-Cg1ywrBHMMCj4Il0QdcVamt5UK9HQ1ntNUXzhAw4yZ2rTJGFkjnkYyEPEpunb1L9orm+g0kvtZUydShTtLUNkA==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.43.0.tgz", + "integrity": "sha512-8FnkipasmOOSSlfucGYEu58U8cxEdhziKjPD2FIa0ONVMxvl/hmONtX/7y4vGjdUhjcTHlKlDhw3H9t98fPvyA==", "cpu": [ "arm64" ], @@ -1511,9 +1511,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.41.2.tgz", - "integrity": "sha512-FxPrm21SE2/p+L/Qy2P6zPPWtbKRunZ71ChHXuZu6b//zOeDYCF7kbXiGdE7ZJgUvboLx8lQtov4jsz04zdmiw==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.43.0.tgz", + "integrity": "sha512-KPPyAdlcIZ6S9C3S2cndXDkV0Bb1OSMsX0Eelr2Bay4EsF9yi9u9uzc9RniK3mcUGCLhWY9oLr6er80P5DE6XA==", "cpu": [ "arm64" ], @@ -1524,9 +1524,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.41.2.tgz", - "integrity": "sha512-Bp2BYb+QWgefn2e8DblGUzejLEyhtG0DnIcSMzAzFtBK33ITvzLM9B8maTHPoy7Cx7XdxEb7l0iNKQAXBZ1NOw==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.43.0.tgz", + "integrity": "sha512-HPGDIH0/ZzAZjvtlXj6g+KDQ9ZMHfSP553za7o2Odegb/BEfwJcR0Sw0RLNpQ9nC6Gy8s+3mSS9xjZ0n3rhcYg==", "cpu": [ "loong64" ], @@ -1537,9 +1537,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.41.2.tgz", - "integrity": "sha512-1DmJwH0PPRPjVwUGHINP1YiH7fO25mhpf2B5N8ubBQdOjEVTRI0x69m8eJGoUSLISoW0kgPX2zTAiHc4zllQ/g==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.43.0.tgz", + "integrity": "sha512-gEmwbOws4U4GLAJDhhtSPWPXUzDfMRedT3hFMyRAvM9Mrnj+dJIFIeL7otsv2WF3D7GrV0GIewW0y28dOYWkmw==", "cpu": [ "ppc64" ], @@ -1550,9 +1550,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.41.2.tgz", - "integrity": "sha512-/9TBJIyoervs137gteTbzOSsIc/Io6xnXvjXYTEEqDRi3a9OokdBwfllN8AmPFGcU+WzoAiTc6n9SJiPohJ3CQ==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.43.0.tgz", + "integrity": "sha512-XXKvo2e+wFtXZF/9xoWohHg+MuRnvO29TI5Hqe9xwN5uN8NKUYy7tXUG3EZAlfchufNCTHNGjEx7uN78KsBo0g==", "cpu": [ "riscv64" ], @@ -1563,9 +1563,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.41.2.tgz", - "integrity": "sha512-qqwpXqu6mV6Vm+EsU2NQk/xLiQfCv+NYmYNCYF8FFIf7kzlHvDoqiNaqqOw0hAr8O5nRBQO+H6X4qEw4Y/0b8w==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.43.0.tgz", + "integrity": "sha512-ruf3hPWhjw6uDFsOAzmbNIvlXFXlBQ4nk57Sec8E8rUxs/AI4HD6xmiiasOOx/3QxS2f5eQMKTAwk7KHwpzr/Q==", "cpu": [ "riscv64" ], @@ -1576,9 +1576,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.41.2.tgz", - "integrity": "sha512-j5oHqcj58pDqN3+CeJdTB3NfHipxIxVIH24VkRlVVhs9jJXks1ovtO4Tf6YxlBzf44ZTx9D2uhO9DZttC/wgUA==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.43.0.tgz", + "integrity": "sha512-QmNIAqDiEMEvFV15rsSnjoSmO0+eJLoKRD9EAa9rrYNwO/XRCtOGM3A5A0X+wmG+XRrw9Fxdsw+LnyYiZWWcVw==", "cpu": [ "s390x" ], @@ -1589,9 +1589,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.41.2.tgz", - "integrity": "sha512-F3fxs7ajUNny4z1TsprdWB9gg8QRwSNSSILVfTmG8rXdeUFWuHEf3Uf5ltrdii8CkzZS3kD/VFPdNVdH3BOpIA==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.43.0.tgz", + "integrity": "sha512-jAHr/S0iiBtFyzjhOkAics/2SrXE092qyqEg96e90L3t9Op8OTzS6+IX0Fy5wCt2+KqeHAkti+eitV0wvblEoQ==", "cpu": [ "x64" ], @@ -1602,9 +1602,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.41.2.tgz", - "integrity": "sha512-2S74RTJ1lJeiX+HSCxlLD/6Z6ndu9/+Huf8kYrI2XTCztFosOWsjPt+aD4cxBG1JTWjoiRYtutc8HABruppFQQ==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.43.0.tgz", + "integrity": "sha512-3yATWgdeXyuHtBhrLt98w+5fKurdqvs8B53LaoKD7P7H7FKOONLsBVMNl9ghPQZQuYcceV5CDyPfyfGpMWD9mQ==", "cpu": [ "x64" ], @@ -1615,9 +1615,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.41.2.tgz", - "integrity": "sha512-LOXSg8GprvL36erslsrNEUirlxy28JcuyTH5PYSBj8wwa0gDQlR8sZricFRbZGCzLhFixvmW2ozj7Mi+j023sg==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.43.0.tgz", + "integrity": "sha512-wVzXp2qDSCOpcBCT5WRWLmpJRIzv23valvcTwMHEobkjippNf+C3ys/+wf07poPkeNix0paTNemB2XrHr2TnGw==", "cpu": [ "arm64" ], @@ -1628,9 +1628,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.41.2.tgz", - "integrity": "sha512-PFhMLaWu0lFziS+buQIJ+YGaifkABS2TGtmeuPRrPO8JKcG17sDSNj358otAP45gIzRWd4o9QM8R+DurDWJgTA==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.43.0.tgz", + "integrity": "sha512-fYCTEyzf8d+7diCw8b+asvWDCLMjsCEA8alvtAutqJOJp/wL5hs1rWSqJ1vkjgW0L2NB4bsYJrpKkiIPRR9dvw==", "cpu": [ "ia32" ], @@ -1641,9 +1641,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.2.tgz", - "integrity": "sha512-AQ5GvrrLYw6dfkfT/bgYg1NU54exCKDrO9JKOE87zy2mdf2CyI6Vayy41r8Vo+kNDpqacaVQppwvYl30YGJu/Q==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.43.0.tgz", + "integrity": "sha512-SnGhLiE5rlK0ofq8kzuDkM0g7FN1s5VYY+YSMTibP7CqShxCQvqtNxTARS4xX4PFJfHjG0ZQYX9iGzI3FQh5Aw==", "cpu": [ "x64" ], @@ -1787,12 +1787,12 @@ } }, "node_modules/@types/node": { - "version": "22.15.30", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.30.tgz", - "integrity": "sha512-6Q7lr06bEHdlfplU6YRbgG1SFBdlsfNC4/lX+SkhiTs0cpJkOElmWls8PxDFv4yY/xKb8Y6SO0OmSX4wgqTZbA==", + "version": "24.0.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.3.tgz", + "integrity": "sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg==", "license": "MIT", "dependencies": { - "undici-types": "~6.21.0" + "undici-types": "~7.8.0" } }, "node_modules/@types/sax": { @@ -1888,9 +1888,9 @@ } }, "node_modules/@vercel/routing-utils": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@vercel/routing-utils/-/routing-utils-5.0.5.tgz", - "integrity": "sha512-TV9bAKHt9qJA/MqnLI10/nHj/EPGbI6CRh8HzKxA9xb1abt2lqvoH7Zi8O7p+VPwk5OD8Ka2j+nB3/5YkZeS/g==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@vercel/routing-utils/-/routing-utils-5.0.7.tgz", + "integrity": "sha512-YIsxOMZIaD+z+lSMsmCo34SZwcyj10UwpZfMbtIKCUtgj8fPwaUtpqKDDvgYWcvxKJ1Px+Hbi4EaYuiXRUEJXw==", "license": "Apache-2.0", "dependencies": { "path-to-regexp": "6.1.0", @@ -1910,9 +1910,9 @@ } }, "node_modules/acorn": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", - "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -2116,12 +2116,12 @@ } }, "node_modules/astro": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/astro/-/astro-5.9.0.tgz", - "integrity": "sha512-AHF7oZDBQRwggHUG0bwBhRQjrDD+vJpCtPd0/GVxDB1hGRV0SQuFWS0UHX5bYczIqFcao1z9o9o0r2rQtHrTMg==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/astro/-/astro-5.9.3.tgz", + "integrity": "sha512-VReZrpUa/3rfeiVvsQ1A2M3ujDPI+pDGIYOMtXPEZwut8tZoEyealXXLjitgCsJ+3dunKGZbg4Eak6i+r0vniw==", "license": "MIT", "dependencies": { - "@astrojs/compiler": "^2.12.0", + "@astrojs/compiler": "^2.12.2", "@astrojs/internal-helpers": "0.6.1", "@astrojs/markdown-remark": "6.3.2", "@astrojs/telemetry": "3.3.0", @@ -2376,9 +2376,9 @@ } }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -2464,9 +2464,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001721", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001721.tgz", - "integrity": "sha512-cOuvmUVtKrtEaoKiO0rSc29jcjwMwX5tOHDy4MgVFEWiUXj4uBMJkwI8MDySkgXidpMiHUcviogAvFi4pA2hDQ==", + "version": "1.0.30001723", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001723.tgz", + "integrity": "sha512-1R/elMjtehrFejxwmexeXAtae5UO9iSyFn6G/I806CYC/BLyyBk1EPhrKBkWhy6wM6Xnm47dSJQec+tLJ39WHw==", "dev": true, "funding": [ { @@ -2829,9 +2829,9 @@ } }, "node_modules/decode-named-character-reference": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.1.0.tgz", - "integrity": "sha512-Wy+JTSbFThEOXQIR2L6mxJvEs+veIzpmqD7ynWxMXGpnk3smkHQOp6forLdHsKpAMW9iJpaBBIxz285t1n1C3w==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.2.0.tgz", + "integrity": "sha512-c6fcElNV6ShtZXmsgNgFFV5tVX2PaV4g+MOAkb8eXHvn6sryJBrZa9r0zV6+dtTyoCKxtDy5tyQ5ZwQuidtd+Q==", "license": "MIT", "dependencies": { "character-entities": "^2.0.0" @@ -2960,9 +2960,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.165", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.165.tgz", - "integrity": "sha512-naiMx1Z6Nb2TxPU6fiFrUrDTjyPMLdTtaOd2oLmG8zVSg2hCWGkhPyxwk+qRmZ1ytwVqUv0u7ZcDA5+ALhaUtw==", + "version": "1.5.168", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.168.tgz", + "integrity": "sha512-RUNQmFLNIWVW6+z32EJQ5+qx8ci6RGvdtDC0Ls+F89wz6I2AthpXF0w0DIrn2jpLX0/PU9ZCo+Qp7bg/EckJmA==", "dev": true, "license": "ISC" }, @@ -2973,9 +2973,9 @@ "license": "MIT" }, "node_modules/entities": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.0.tgz", - "integrity": "sha512-aKstq2TDOndCn4diEyp9Uq/Flu2i1GlLkc6XIDQSDMuaFE3OPW5OphLCyQ5SpSJZTb4reN+kTcYru5yIfXoRPw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", "license": "BSD-2-Clause", "engines": { "node": ">=0.12" @@ -3147,9 +3147,9 @@ } }, "node_modules/fdir": { - "version": "6.4.5", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.5.tgz", - "integrity": "sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw==", + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", + "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", "license": "MIT", "peerDependencies": { "picomatch": "^3 || ^4" @@ -4781,9 +4781,9 @@ } }, "node_modules/miniflare": { - "version": "4.20250525.1", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20250525.1.tgz", - "integrity": "sha512-4PJlT5WA+hfclFU5Q7xnpG1G1VGYTXaf/3iu6iKQ8IsbSi9QvPTA2bSZ5goCFxmJXDjV4cxttVxB0Wl1CLuQ0w==", + "version": "4.20250604.1", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20250604.1.tgz", + "integrity": "sha512-HJQ9YhH0F0fI73Vsdy3PNVau+PfHZYK7trI5WJEcbfl5HzqhMU0DRNtA/G5EXQgiumkjrmbW4Zh1DVTtsqICPg==", "dev": true, "license": "MIT", "dependencies": { @@ -4795,7 +4795,7 @@ "sharp": "^0.33.5", "stoppable": "1.1.0", "undici": "^5.28.5", - "workerd": "1.20250525.0", + "workerd": "1.20250604.0", "ws": "8.18.0", "youch": "3.3.4", "zod": "3.22.3" @@ -5304,9 +5304,9 @@ } }, "node_modules/postcss": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.4.tgz", - "integrity": "sha512-QSa9EBe+uwlGTFmHsPKokv3B/oEMQZxfqW0QqNCyhpa6mB1afzulwn8hihglqAb2pOw+BJgNlmXQ8la2VeHB7w==", + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", "funding": [ { "type": "opencollective", @@ -5968,9 +5968,9 @@ } }, "node_modules/rollup": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.41.2.tgz", - "integrity": "sha512-6VwIRjxJPRGfwtHnBWrApOrFposYNARbBUnBzWSBYutdukosTadkxSB1prmEd95jhiJ1uWtZOD3sDx7qfVwu4A==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.43.0.tgz", + "integrity": "sha512-wdN2Kd3Twh8MAEOEJZsuxuLKCsBEo4PVNLK6tQWAn10VhsVewQLzcucMgLolRlhFybGxfclbPeEYBaP6RvUFGg==", "license": "MIT", "dependencies": { "@types/estree": "1.0.7" @@ -5983,26 +5983,26 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.41.2", - "@rollup/rollup-android-arm64": "4.41.2", - "@rollup/rollup-darwin-arm64": "4.41.2", - "@rollup/rollup-darwin-x64": "4.41.2", - "@rollup/rollup-freebsd-arm64": "4.41.2", - "@rollup/rollup-freebsd-x64": "4.41.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.41.2", - "@rollup/rollup-linux-arm-musleabihf": "4.41.2", - "@rollup/rollup-linux-arm64-gnu": "4.41.2", - "@rollup/rollup-linux-arm64-musl": "4.41.2", - "@rollup/rollup-linux-loongarch64-gnu": "4.41.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.41.2", - "@rollup/rollup-linux-riscv64-gnu": "4.41.2", - "@rollup/rollup-linux-riscv64-musl": "4.41.2", - "@rollup/rollup-linux-s390x-gnu": "4.41.2", - "@rollup/rollup-linux-x64-gnu": "4.41.2", - "@rollup/rollup-linux-x64-musl": "4.41.2", - "@rollup/rollup-win32-arm64-msvc": "4.41.2", - "@rollup/rollup-win32-ia32-msvc": "4.41.2", - "@rollup/rollup-win32-x64-msvc": "4.41.2", + "@rollup/rollup-android-arm-eabi": "4.43.0", + "@rollup/rollup-android-arm64": "4.43.0", + "@rollup/rollup-darwin-arm64": "4.43.0", + "@rollup/rollup-darwin-x64": "4.43.0", + "@rollup/rollup-freebsd-arm64": "4.43.0", + "@rollup/rollup-freebsd-x64": "4.43.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.43.0", + "@rollup/rollup-linux-arm-musleabihf": "4.43.0", + "@rollup/rollup-linux-arm64-gnu": "4.43.0", + "@rollup/rollup-linux-arm64-musl": "4.43.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.43.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.43.0", + "@rollup/rollup-linux-riscv64-gnu": "4.43.0", + "@rollup/rollup-linux-riscv64-musl": "4.43.0", + "@rollup/rollup-linux-s390x-gnu": "4.43.0", + "@rollup/rollup-linux-x64-gnu": "4.43.0", + "@rollup/rollup-linux-x64-musl": "4.43.0", + "@rollup/rollup-win32-arm64-msvc": "4.43.0", + "@rollup/rollup-win32-ia32-msvc": "4.43.0", + "@rollup/rollup-win32-x64-msvc": "4.43.0", "fsevents": "~2.3.2" } }, @@ -6674,9 +6674,9 @@ } }, "node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", + "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==", "license": "MIT" }, "node_modules/unenv": { @@ -7244,9 +7244,9 @@ } }, "node_modules/workerd": { - "version": "1.20250525.0", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250525.0.tgz", - "integrity": "sha512-SXJgLREy/Aqw2J71Oah0Pbu+SShbqbTExjVQyRBTM1r7MG7fS5NUlknhnt6sikjA/t4cO09Bi8OJqHdTkrcnYQ==", + "version": "1.20250604.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250604.0.tgz", + "integrity": "sha512-sHz9R1sxPpnyq3ptrI/5I96sYTMA2+Ljm75oJDbmEcZQwNyezpu9Emerzt3kzzjCJQqtdscGOidWv4RKGZXzAA==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -7257,17 +7257,17 @@ "node": ">=16" }, "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20250525.0", - "@cloudflare/workerd-darwin-arm64": "1.20250525.0", - "@cloudflare/workerd-linux-64": "1.20250525.0", - "@cloudflare/workerd-linux-arm64": "1.20250525.0", - "@cloudflare/workerd-windows-64": "1.20250525.0" + "@cloudflare/workerd-darwin-64": "1.20250604.0", + "@cloudflare/workerd-darwin-arm64": "1.20250604.0", + "@cloudflare/workerd-linux-64": "1.20250604.0", + "@cloudflare/workerd-linux-arm64": "1.20250604.0", + "@cloudflare/workerd-windows-64": "1.20250604.0" } }, "node_modules/wrangler": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.19.1.tgz", - "integrity": "sha512-b+ed2SJKauHgndl4Im1wHE+FeSSlrdlEZNuvpc8q/94k4EmRxRkXnwBAsVWuicBxG3HStFLQPGGlvL8wGKTtHw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.20.0.tgz", + "integrity": "sha512-gxMLaSnYp3VLdGPZu4fc/9UlB7PnSVwni25v32NM9szG2yTt+gx5RunWzmoLplplIfEMkBuV3wA47vccNu7zcA==", "dev": true, "license": "MIT OR Apache-2.0", "dependencies": { @@ -7275,10 +7275,10 @@ "@cloudflare/unenv-preset": "2.3.2", "blake3-wasm": "2.1.5", "esbuild": "0.25.4", - "miniflare": "4.20250525.1", + "miniflare": "4.20250604.1", "path-to-regexp": "6.3.0", "unenv": "2.0.0-rc.17", - "workerd": "1.20250525.0" + "workerd": "1.20250604.0" }, "bin": { "wrangler": "bin/wrangler.js", @@ -7291,7 +7291,7 @@ "fsevents": "~2.3.2" }, "peerDependencies": { - "@cloudflare/workers-types": "^4.20250525.0" + "@cloudflare/workers-types": "^4.20250604.0" }, "peerDependenciesMeta": { "@cloudflare/workers-types": { @@ -7984,9 +7984,9 @@ } }, "node_modules/zod": { - "version": "3.25.55", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.55.tgz", - "integrity": "sha512-219huNnkSLQnLsQ3uaRjXsxMrVm5C9W3OOpEVt2k5tvMKuA8nBSu38e0B//a+he9Iq2dvmk2VyYVlHqiHa4YBA==", + "version": "3.25.65", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.65.tgz", + "integrity": "sha512-kMyE2qsXK1p+TAvO7zsf5wMFiCejU3obrUDs9bR1q5CBKykfvp7QhhXrycUylMoOow0iEUSyjLlZZdCsHwSldQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/public/robots.txt b/public/robots.txt index 6880506..5f71238 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,4 +1,6 @@ User-agent: * +Disallow: /_render +Disallow: /api/ Allow: / -Sitemap: https://fav.jpdiaz.dev/sitemap-index.xml +Sitemap: https://fav.jpdiaz.dev/sitemap-index.xml \ No newline at end of file diff --git a/src/pages/artists/[mbid].astro b/src/pages/artists/[mbid].astro index 01fa87c..f2715c8 100644 --- a/src/pages/artists/[mbid].astro +++ b/src/pages/artists/[mbid].astro @@ -1,6 +1,18 @@ --- import Layout from '@layouts/Layout.astro'; import ArtistDetails from '@pages/fragments/ArtistDetails/[mbid].astro'; +import type { GetStaticPaths } from 'astro'; +import artistsData from '@data/artistDetails.json'; + +// This is required for static site generation +export async function getStaticPaths() { + const artistEntries = artistsData.allArtists || []; + return artistEntries.map((artist) => ({ + params: { mbid: artist.id }, + })); +} + +const { mbid } = Astro.params; --- diff --git a/src/pages/books/[id].astro b/src/pages/books/[id].astro index 7760fa0..22144ae 100644 --- a/src/pages/books/[id].astro +++ b/src/pages/books/[id].astro @@ -6,27 +6,24 @@ import { metadata } from '@config/metadata.js'; const pageTitle = `Book Details — ${metadata.name || "Juan's Favorites"}`; const pageDescription = `Details for a selected book from ${metadata.name || "Juan's Favorites"}.`; -// For SSR (which this project uses based on cloudflare adapter with output: "server"), -// getStaticPaths is not strictly needed for dynamic routing to work. -// The [id].astro page will be rendered on demand. -// If pre-rendering all book pages at build time was desired, getStaticPaths would be: -// export async function getStaticPaths() { -// try { -// const results = await Astro.glob('@data/books/bookDetails.json'); -// if (results && results.length > 0) { -// const bookJsonData = results[0].default || results[0]; -// if (bookJsonData && bookJsonData.allBooks) { -// return bookJsonData.allBooks.map(book => ({ -// params: { id: book.id || book.slug }, // Ensure 'id' or 'slug' matches what's used in fragment -// // props: { book } // Optionally pass full book data as props to avoid re-fetch in fragment -// })); -// } -// } -// } catch (error) { -// console.error("Error in getStaticPaths for books:", error); -// } -// return []; // Fallback to empty paths if error or no data -// } +// For static site generation, getStaticPaths is required for dynamic routing +import type { GetStaticPaths } from 'astro'; +import booksData from '@data/myFavBooks.json'; + +// Generate static paths for all books +export const getStaticPaths = (() => { + try { + if (Array.isArray(booksData)) { + return booksData.map(book => ({ + params: { id: book.api_id || String(book._id) }, + })); + } + return []; + } catch (error) { + console.error("Error in getStaticPaths for books:", error); + return []; // Fallback to empty paths if error or no data + } +}) satisfies GetStaticPaths; --- diff --git a/src/pages/fragments/BookDetails/[id].astro b/src/pages/fragments/BookDetails/[id].astro index bfe806f..ee5f7e6 100644 --- a/src/pages/fragments/BookDetails/[id].astro +++ b/src/pages/fragments/BookDetails/[id].astro @@ -1,4 +1,23 @@ --- +import type { GetStaticPaths } from 'astro'; +import booksData from '@data/myFavBooks.json'; + +// Generate static paths for all books in the data file +export const getStaticPaths = (() => { + try { + if (Array.isArray(booksData)) { + return booksData.map(book => ({ + params: { id: book.api_id || String(book._id) }, + props: { bookData: book }, + })); + } + return []; + } catch (error) { + console.error("Error in getStaticPaths for book details fragment:", error); + return []; // Fallback to empty paths if error or no data + } +}) satisfies GetStaticPaths; + const { id } = Astro.params; // Get the book's OpenLibrary Work ID from the URL let book = null; let fetchError = null; diff --git a/src/pages/fragments/GameDetails/[slug].astro b/src/pages/fragments/GameDetails/[slug].astro index 67d318e..08dec14 100644 --- a/src/pages/fragments/GameDetails/[slug].astro +++ b/src/pages/fragments/GameDetails/[slug].astro @@ -1,36 +1,35 @@ --- import Modal from '@components/Modal.astro'; +import gameData from '@data/gameDetails.json'; -const { slug } = Astro.params; // Get the game slug from the URL -let game = null; -let fetchError = null; - -try { - const results = await Astro.glob('@data/gameDetails.json'); - if (results && results.length > 0) { - const gameJsonData = results[0].default || results[0]; - if (gameJsonData && gameJsonData.allGames) { - game = gameJsonData.allGames.find((g) => g.slug === slug); - if (!game) { - fetchError = `Game with slug "${slug}" not found.`; - } else { - // Dynamically set page title - this is an experimental way and might not work as expected - // A more common way is to pass title to Layout from the page itself. - // For fragments, this is less direct. - // Astro.props.title = `${game.name} — ${SITE_TITLE}`; // This won't work directly - // If htmx is used for fragment swaps, one might set HX-Set-Title header. - // For now, title is set in src/pages/games/[slug].astro - } +// For static site generation, pre-define all game slugs +export async function getStaticPaths() { + try { + // Generate paths for all games + if (gameData && gameData.allGames && Array.isArray(gameData.allGames)) { + return gameData.allGames.map(game => ({ + params: { slug: game.slug }, + props: { gameData: game } // Pass the game data as props + })); } else { - fetchError = - 'Game data is not in the expected format or "allGames" key is missing in imported JSON.'; + console.error('Error in getStaticPaths for game details fragment: gameData.allGames is not an array'); + return []; } - } else { - fetchError = 'Game data file (gameDetails.json) not found. Please run `npm run fetch-games`.'; + } catch (error) { + console.error('Error in getStaticPaths for game details fragment:', error); + return []; // Fallback to empty paths if error } -} catch (error) { - console.error(`Error loading or processing gameDetails.json for game slug "${slug}":`, error); - fetchError = `Failed to load game data. Details: ${error.message}`; +} + +// Get slug and game data from params and props +const { slug } = Astro.params; // Get the game slug from the URL +// Use game data passed from getStaticPaths function +let game = Astro.props.gameData; +let fetchError = null; + +// Fallback error handling if props weren't passed correctly +if (!game) { + fetchError = `Game data not available for slug "${slug}". This may be an issue with static generation.`; } const placeholderImageUrl = 'https://via.placeholder.com/500x750.png?text=No+Cover+Art'; // For main cover diff --git a/src/pages/fragments/MovieDetails/[id].astro b/src/pages/fragments/MovieDetails/[id].astro index 0ae7f92..0d540ca 100644 --- a/src/pages/fragments/MovieDetails/[id].astro +++ b/src/pages/fragments/MovieDetails/[id].astro @@ -1,40 +1,70 @@ --- import Modal from '@components/Modal.astro'; +import movieDetailsJson from '@data/movieDetails.json'; +// For static site generation, pre-define all movie IDs +export async function getStaticPaths() { + try { + const allMovies = []; + + // Movie data is organized by genre categories + if (movieDetailsJson) { + // Iterate through each genre category + Object.keys(movieDetailsJson).forEach(genre => { + if (Array.isArray(movieDetailsJson[genre])) { + // Add all movies from this genre to our collection + movieDetailsJson[genre].forEach(movie => { + if (movie.id) { + allMovies.push(movie); + } + }); + } + }); + } + + // Generate paths for all movies + return allMovies.map(movie => ({ + params: { id: String(movie.id) }, + props: { movieData: movie } // Pass the movie data as props + })); + } catch (error) { + console.error('Error in getStaticPaths for MovieDetails:', error); + return []; // Fallback to empty paths if error + } +} + +// Get parameters from Astro const { id } = Astro.params; -const url = `https://api.themoviedb.org/3/movie/${id}?append_to_response=credits,videos,images,recommendations&api_key=${ - import.meta.env.TMDB_API_KEY -}`; +const movieData = Astro.props.movieData; -const response = await fetch(url); -const data = await response.json(); +// Format movie data for display const movie = { - ...data, - poster_path: data.poster_path - ? 'https://image.tmdb.org/t/p/w500/' + data.poster_path + ...movieData, + poster_path: movieData.poster_path + ? 'https://image.tmdb.org/t/p/w500/' + movieData.poster_path : 'https://via.placeholder.com/500x750', - vote_average: (data.vote_average * 10).toFixed(2) + '%', - release_date: new Date(data.release_date).toLocaleDateString('en-us', { + vote_average: (movieData.vote_average * 10).toFixed(2) + '%', + release_date: new Date(movieData.release_date).toLocaleDateString('en-us', { year: 'numeric', month: 'long', day: 'numeric', }), - genres: data.genres.map((g) => g.name).join(', '), - crew: data.credits.crew.slice(0, 3), - cast: data.credits.cast.slice(0, 5).map((c) => ({ + genres: movieData.genres.map((g) => g.name).join(', '), + crew: movieData.credits?.crew?.slice(0, 3) || [], + cast: movieData.credits?.cast?.slice(0, 5).map((c) => ({ ...c, profile_path: c.profile_path ? 'https://image.tmdb.org/t/p/w300/' + c.profile_path : 'https://via.placeholder.com/300x450', - })), - morelike: data.recommendations.results.slice(0, 5).map((m) => ({ + })) || [], + morelike: movieData.recommendations?.results?.slice(0, 5).map((m) => ({ ...m, poster_path: m.poster_path ? 'https://image.tmdb.org/t/p/w500/' + m.poster_path : 'https://via.placeholder.com/500x750', - })), - images: data.images.backdrops.slice(0, 6), - videos: data.videos, + })) || [], + images: movieData.images?.backdrops?.slice(0, 6) || [], + videos: movieData.videos || { results: [] }, }; // console.log("more like this", movie.recommendations.results.slice(0, 5)); // console.log("video", movie.videos.results.slice(0, 1)); diff --git a/src/pages/fragments/PersonDetails/[id].astro b/src/pages/fragments/PersonDetails/[id].astro index 424634b..8cce854 100644 --- a/src/pages/fragments/PersonDetails/[id].astro +++ b/src/pages/fragments/PersonDetails/[id].astro @@ -1,4 +1,44 @@ --- +import movieDetailsJson from '@data/movieDetails.json'; + +// For static site generation, pre-define all person IDs +export async function getStaticPaths() { + try { + const personIds = new Set(); + + // Movie data is organized by genre categories + if (movieDetailsJson) { + // Iterate through each genre category + Object.keys(movieDetailsJson).forEach(genre => { + if (Array.isArray(movieDetailsJson[genre])) { + // Add all person IDs from cast and crew + movieDetailsJson[genre].forEach(movie => { + if (movie.credits) { + // Add cast members + movie.credits.cast?.forEach(castMember => { + if (castMember.id) personIds.add(String(castMember.id)); + }); + + // Add crew members + movie.credits.crew?.forEach(crewMember => { + if (crewMember.id) personIds.add(String(crewMember.id)); + }); + } + }); + } + }); + } + + // Generate paths for all unique person IDs + return Array.from(personIds).map(id => ({ + params: { id } + })); + } catch (error) { + console.error('Error in getStaticPaths for PersonDetails:', error); + return []; // Fallback to empty paths if error + } +} + const { id } = Astro.params; const profileUrl = `https://api.themoviedb.org/3/person/${id}?append_to_response=external_ids,combined_credits&api_key=${ import.meta.env.TMDB_API_KEY diff --git a/src/pages/fragments/PodcastDetails/[id].astro b/src/pages/fragments/PodcastDetails/[id].astro index 203cf62..6ae7f35 100644 --- a/src/pages/fragments/PodcastDetails/[id].astro +++ b/src/pages/fragments/PodcastDetails/[id].astro @@ -1,26 +1,36 @@ --- -const { id } = Astro.params; // Get the podcast ID from the URL -let podcast = null; -let fetchError = null; +import podcastDetailsJson from '@data/podcastDetails.json'; -try { - const results = await Astro.glob('@data/podcastDetails.json'); - if (results && results.length > 0) { - const podcastJsonData = results[0].default || results[0]; - if (podcastJsonData && podcastJsonData.allPodcasts) { - podcast = podcastJsonData.allPodcasts.find(p => p.id.toString() === id.toString()); - if (!podcast) { - fetchError = `Podcast with ID "${id}" not found.`; - } +// For static site generation, define all podcast IDs to pre-render +export async function getStaticPaths() { + try { + // Extract all podcast IDs from the JSON data + if (podcastDetailsJson && podcastDetailsJson.allPodcasts) { + return podcastDetailsJson.allPodcasts.map(podcast => ({ + params: { id: podcast.id }, + props: { podcastData: podcast } // Pass podcast data as props to avoid fetching again + })); } else { - fetchError = 'Podcast data is not in the expected format or "allPodcasts" key is missing in imported JSON.'; + console.error('Podcast data is missing or malformed in podcastDetails.json'); + return []; } - } else { - fetchError = 'Podcast data file not found via Astro.glob.'; + } catch (error) { + console.error('Error processing podcast data for getStaticPaths:', error); + return []; } -} catch (error) { - console.error(`Error loading or processing podcastDetails.json for podcast ${id} via Astro.glob:`, error); - fetchError = `Failed to load podcast data. Details: ${error.message}`; +} + +const { id } = Astro.params; // Get the podcast ID from the URL +const { podcastData } = Astro.props; // Get the podcast data passed from getStaticPaths + +// Use the passed data directly instead of fetching +let podcast = podcastData; +let fetchError = null; + +// Set fetchError if data is somehow missing +if (!podcast) { + fetchError = `Podcast with ID "${id}" not found.`; + console.error(`Podcast data missing for ID: ${id} in static props`); } // Placeholder for missing image diff --git a/src/pages/fragments/PodcastList/index.astro b/src/pages/fragments/PodcastList/index.astro index c7aea83..10e5903 100644 --- a/src/pages/fragments/PodcastList/index.astro +++ b/src/pages/fragments/PodcastList/index.astro @@ -1,35 +1,23 @@ --- import PodcastCard from '@components/PodcastCard.astro'; +import podcastDetailsJson from '@data/podcastDetails.json'; let allPodcasts = []; let fetchError = null; try { - // Use Astro.glob to import the JSON data. - // Note: Astro.glob returns an array of modules. For a single file, we take the first. - // The content of the JSON file is usually the default export. - const results = await Astro.glob('@data/podcastDetails.json'); - if (results && results.length > 0) { - // For JSON files, Astro.glob provides the parsed content directly. - // If it were a module with exports, it might be results[0].default or results[0].allPodcasts - // Let's assume it's the direct content or default export which is the object. - const podcastJsonData = results[0].default || results[0]; - if (podcastJsonData && podcastJsonData.allPodcasts) { - allPodcasts = podcastJsonData.allPodcasts; - } else { - console.warn( - 'No "allPodcasts" key found in the imported podcastDetails.json or data is null/malformed.' - ); - fetchError = 'Podcast data is not in the expected format.'; - allPodcasts = []; - } + // Use direct import instead of Astro.glob + if (podcastDetailsJson && podcastDetailsJson.allPodcasts) { + allPodcasts = podcastDetailsJson.allPodcasts; } else { - console.warn('podcastDetails.json file not found via Astro.glob.'); - fetchError = 'Podcast data file not found.'; + console.warn( + 'No "allPodcasts" key found in the imported podcastDetails.json or data is null/malformed.' + ); + fetchError = 'Podcast data is not in the expected format.'; allPodcasts = []; } } catch (error) { - console.error('Error loading or processing podcastDetails.json via Astro.glob:', error); + console.error('Error processing podcastDetails.json:', error); fetchError = `Failed to load podcast data. Details: ${error.message}`; allPodcasts = []; // Ensure it's an array } diff --git a/src/pages/fragments/TvDetails/[id].astro b/src/pages/fragments/TvDetails/[id].astro index 322aa93..becc61f 100644 --- a/src/pages/fragments/TvDetails/[id].astro +++ b/src/pages/fragments/TvDetails/[id].astro @@ -1,43 +1,67 @@ --- import Modal from '@components/Modal.astro'; +import tvShowDetailsJson from '@data/tvShowDetails.json'; + +// For static site generation, define all TV show IDs to pre-render +export async function getStaticPaths() { + try { + const tvShowIds = new Set(); + + // Extract TV show IDs from the JSON data + if (tvShowDetailsJson && tvShowDetailsJson.regular) { + return tvShowDetailsJson.regular.map(show => ({ + params: { id: String(show.id) }, + props: { showData: show } // Pass TV show data as props to avoid fetching again + })); + } else { + console.error('TV show data is missing or malformed in tvShowDetails.json'); + return []; + } + } catch (error) { + console.error('Error processing TV show data for getStaticPaths:', error); + return []; + } +} const { id } = Astro.params; -const url = `https://api.themoviedb.org/3/tv/${id}?append_to_response=credits,videos,images,recommendations&api_key=${ - import.meta.env.TMDB_API_KEY -}`; +const { showData } = Astro.props; // Get the TV show data passed from getStaticPaths + +// Process the static show data for display +// Add a type assertion to allow any properties to be accessed +const typedShowData = showData as any; -const response = await fetch(url); -const data = await response.json(); const show = { - ...data, - poster_path: data.poster_path - ? 'https://image.tmdb.org/t/p/w500/' + data.poster_path + ...typedShowData, + poster_path: typedShowData.poster_path + ? 'https://image.tmdb.org/t/p/w500/' + typedShowData.poster_path : 'https://via.placeholder.com/500x750', - vote_average: (data.vote_average * 10).toFixed(2) + '%', - first_air_date: new Date(data.first_air_date).toLocaleDateString('en-us', { + vote_average: (typedShowData.vote_average * 10).toFixed(2) + '%', + first_air_date: new Date(typedShowData.first_air_date).toLocaleDateString('en-us', { year: 'numeric', month: 'long', day: 'numeric', }), - genres: data.genres.map((g) => g.name).join(', '), - cast: data.credits.cast.slice(0, 5).map((c) => ({ + genres: typedShowData.genres?.map((g) => g.name).join(', ') || 'N/A', + // Safely access nested properties with optional chaining + cast: typedShowData.credits?.cast?.slice(0, 5).map((c) => ({ ...c, profile_path: c.profile_path ? 'https://image.tmdb.org/t/p/w300/' + c.profile_path : 'https://via.placeholder.com/300x450', - })), - images: data.images.backdrops.slice(0, 9), - morelike: data.recommendations.results.slice(0, 5).map((m) => ({ + })) || [], + images: typedShowData.images?.backdrops?.slice(0, 9) || [], + morelike: typedShowData.recommendations?.results?.slice(0, 5).map((m) => ({ ...m, poster_path: m.poster_path ? 'https://image.tmdb.org/t/p/w500/' + m.poster_path : 'https://via.placeholder.com/500x750', - })), - - // videos: data.videos, + })) || [], + videos: typedShowData.videos || { results: [] }, + // Ensure that created_by exists with a default + created_by: typedShowData.created_by || [] }; -// console.log("more like this", show.recommendations.results.slice(0, 5)); -// console.log("video", movie.videos.results.slice(0, 1)); +// console.log("more like this", show.morelike); +// console.log("video", show.videos?.results?.slice(0, 1)); ---
@@ -86,7 +110,7 @@ const show = {
{ - show.videos.results.length && ( + show.videos?.results?.length && ( <>
diff --git a/src/pages/games/[slug].astro b/src/pages/games/[slug].astro index 85f46f3..213d7f2 100644 --- a/src/pages/games/[slug].astro +++ b/src/pages/games/[slug].astro @@ -1,6 +1,25 @@ --- import Layout from '@layouts/Layout.astro'; import GameDetailsFragment from '@pages/fragments/GameDetails/[slug].astro'; +import gameData from '@data/gameDetails.json'; + +// For static site generation, pre-define all game slugs +export async function getStaticPaths() { + try { + // Generate paths for all games + if (gameData && gameData.allGames && Array.isArray(gameData.allGames)) { + return gameData.allGames.map(game => ({ + params: { slug: game.slug } + })); + } else { + console.error('Error in getStaticPaths for games: gameData.allGames is not an array'); + return []; + } + } catch (error) { + console.error('Error in getStaticPaths for games:', error); + return []; // Fallback to empty paths if error + } +} --- diff --git a/src/pages/movies/[id].astro b/src/pages/movies/[id].astro index ba849ba..419ed71 100644 --- a/src/pages/movies/[id].astro +++ b/src/pages/movies/[id].astro @@ -1,8 +1,33 @@ --- import Layout from '@layouts/Layout.astro'; import MovieDetails from '@pages/fragments/MovieDetails/[id].astro'; +import type { GetStaticPaths } from 'astro'; +import movieData from '@data/movieDetails.json'; + +// This is required for static site generation +export const getStaticPaths = (() => { + const allMovies = []; + + // Collect all movies from all genres + Object.keys(movieData).forEach(genre => { + if (Array.isArray(movieData[genre])) { + allMovies.push(...movieData[genre]); + } + }); + + // Remove duplicates by movie ID + const uniqueMovies = [...new Map(allMovies.map(movie => [movie.id, movie])).values()]; + + return uniqueMovies.map((movie) => ({ + params: { id: String(movie.id) }, + props: { movieData: movie } // Pass the movie data as props + })); +}) satisfies GetStaticPaths; + +const { id } = Astro.params; +const { movieData: movieDetails } = Astro.props; // Get movie data from props --- - + diff --git a/src/pages/people/[id].astro b/src/pages/people/[id].astro index 66a5adf..ea2009b 100644 --- a/src/pages/people/[id].astro +++ b/src/pages/people/[id].astro @@ -1,6 +1,53 @@ --- import Layout from '@layouts/Layout.astro'; import PersonDetails from '@pages/fragments/PersonDetails/[id].astro'; +import movieData from '@data/movieDetails.json'; + +// For static site generation, we need to pre-define all the people IDs +// We'll extract person IDs from the movieDetails.json credits +export async function getStaticPaths() { + // This set will store unique person IDs + const personIds = new Set(); + + try { + // Movie data is organized by genre categories + if (movieData) { + // Iterate through each genre category + Object.keys(movieData).forEach(genre => { + if (Array.isArray(movieData[genre])) { + // Iterate through each movie in this genre + movieData[genre].forEach(movie => { + // Add person IDs from cast if available + if (movie.credits?.cast) { + movie.credits.cast.forEach(castMember => { + if (castMember.id) { + personIds.add(String(castMember.id)); + } + }); + } + + // Add person IDs from crew if available + if (movie.credits?.crew) { + movie.credits.crew.forEach(crewMember => { + if (crewMember.id) { + personIds.add(String(crewMember.id)); + } + }); + } + }); + } + }); + } + + // Convert the Set to an array of path objects + return Array.from(personIds).map(id => ({ + params: { id }, + })); + } catch (error) { + console.error("Error in getStaticPaths for people:", error); + return []; // Fallback to empty paths if error + } +} --- diff --git a/src/pages/podcasts/[id].astro b/src/pages/podcasts/[id].astro index 94e9b23..91b7a3f 100644 --- a/src/pages/podcasts/[id].astro +++ b/src/pages/podcasts/[id].astro @@ -1,8 +1,29 @@ --- import Layout from '@layouts/Layout.astro'; import PodcastDetailsFragment from '@pages/fragments/PodcastDetails/[id].astro'; +import type { GetStaticPaths } from 'astro'; +import podcastData from '@data/podcastDetails.json'; + +// This is required for static site generation +export const getStaticPaths = (() => { + try { + if (podcastData && Array.isArray(podcastData.allPodcasts)) { + return podcastData.allPodcasts.map(podcast => ({ + params: { id: podcast.id }, + props: { podcastData: podcast } // Pass podcast data as props + })); + } + return []; + } catch (error) { + console.error("Error in getStaticPaths for podcasts:", error); + return []; // Fallback to empty paths if error or no data + } +}) satisfies GetStaticPaths; + +const { id } = Astro.params; +const { podcastData: podcast } = Astro.props; // Get podcast data from props --- - + diff --git a/src/pages/tv/[id].astro b/src/pages/tv/[id].astro index 7680bce..0633199 100644 --- a/src/pages/tv/[id].astro +++ b/src/pages/tv/[id].astro @@ -1,8 +1,32 @@ --- import Layout from '@layouts/Layout.astro'; import TvDetails from '@pages/fragments/TvDetails/[id].astro'; +import type { GetStaticPaths } from 'astro'; +import tvData from '@data/tvShowDetails.json'; + +// This is required for static site generation +export const getStaticPaths = (() => { + const allShows = []; + + // Combine regular and spanish shows + if (Array.isArray(tvData.regular)) { + allShows.push(...tvData.regular); + } + + if (Array.isArray(tvData.spanish)) { + allShows.push(...tvData.spanish); + } + + return allShows.map((show) => ({ + params: { id: String(show.id) }, + props: { showData: show } // Pass the show data as props + })); +}) satisfies GetStaticPaths; + +const { id } = Astro.params; +const { showData } = Astro.props; // Get show data from props --- - +