diff --git a/options.ts b/options.ts index 4281a14..4801392 100644 --- a/options.ts +++ b/options.ts @@ -188,7 +188,7 @@ const options: z.input = { post: 5, comment: 5, tag: 10, - calendar: false, + calendar: true, }, comments: { enable: true, diff --git a/package-lock.json b/package-lock.json index 2f2461d..ed710f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,14 +11,14 @@ "dependencies": { "@astrojs/mdx": "^4.0.3", "@astrojs/node": "^9.0.0", - "@astrojs/rss": "^4.0.10", - "astro": "^5.1.1", + "@astrojs/rss": "^4.0.11", + "astro": "^5.1.2", "drizzle-orm": "^0.38.3", "fuse.js": "^7.0.0", "glob": "^11.0.0", "lodash": "^4.17.21", "luxon": "^3.5.0", - "marked": "^15.0.4", + "marked": "^15.0.5", "pg": "^8.13.1", "pinyin-pro": "^3.26.0", "qrcode-svg": "^1.1.0", @@ -29,10 +29,10 @@ "@astrojs/check": "^0.9.4", "@biomejs/biome": "^1.9.4", "@napi-rs/canvas": "^0.1.65", - "@shikijs/transformers": "^1.24.4", + "@shikijs/transformers": "^1.25.1", "@types/lodash": "^4.17.13", "@types/luxon": "^3.4.2", - "@types/node": "^22.10.2", + "@types/node": "^22.10.4", "@types/pg": "^8.11.10", "@types/qrcode-svg": "^1.1.5", "@types/unist": "^3.0.3", @@ -211,9 +211,9 @@ } }, "node_modules/@astrojs/rss": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/@astrojs/rss/-/rss-4.0.10.tgz", - "integrity": "sha512-2gFdHM763uUAySkdwPYrpi6dppOBJr9ddg5VbkKXctWze8d1JHgIBBY78zWIYs7KBJT58zxadsObVAVt55RDaw==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/@astrojs/rss/-/rss-4.0.11.tgz", + "integrity": "sha512-3e3H8i6kc97KGnn9iaZBJpIkdoQi8MmR5zH5R+dWsfCM44lLTszOqy1OBfGGxDt56mpQkYVtZJWoxMyWuUZBfw==", "license": "MIT", "dependencies": { "fast-xml-parser": "^4.5.0", @@ -2030,54 +2030,72 @@ ] }, "node_modules/@shikijs/core": { - "version": "1.24.4", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.24.4.tgz", - "integrity": "sha512-jjLsld+xEEGYlxAXDyGwWsKJ1sw5Pc1pnp4ai2ORpjx2UX08YYTC0NNqQYO1PaghYaR+PvgMOGuvzw2he9sk0Q==", + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.25.1.tgz", + "integrity": "sha512-0j5k3ZkLTQViOuNzPVyWGoW1zgH3kiFdUT/JOCkTm7TU74mz+dF+NID+YoiCBzHQxgsDpcGYPjKDJRcuVLSt4A==", "license": "MIT", "dependencies": { - "@shikijs/engine-javascript": "1.24.4", - "@shikijs/engine-oniguruma": "1.24.4", - "@shikijs/types": "1.24.4", + "@shikijs/engine-javascript": "1.25.1", + "@shikijs/engine-oniguruma": "1.25.1", + "@shikijs/types": "1.25.1", "@shikijs/vscode-textmate": "^9.3.1", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.4" } }, "node_modules/@shikijs/engine-javascript": { - "version": "1.24.4", - "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.24.4.tgz", - "integrity": "sha512-TClaQOLvo9WEMJv6GoUsykQ6QdynuKszuORFWCke8qvi6PeLm7FcD9+7y45UenysxEWYpDL5KJaVXTngTE+2BA==", + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.25.1.tgz", + "integrity": "sha512-zQ7UWKnRCfD/Q1M+XOSyjsbhpE0qv8LUnmn82HYCeOsgAHgUZGEDIQ63bbuK3kU5sQg+2CtI+dPfOqD/mjSY9w==", "license": "MIT", "dependencies": { - "@shikijs/types": "1.24.4", + "@shikijs/types": "1.25.1", "@shikijs/vscode-textmate": "^9.3.1", - "oniguruma-to-es": "0.8.1" + "oniguruma-to-es": "0.10.0" } }, "node_modules/@shikijs/engine-oniguruma": { - "version": "1.24.4", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.24.4.tgz", - "integrity": "sha512-Do2ry6flp2HWdvpj2XOwwa0ljZBRy15HKZITzPcNIBOGSeprnA8gOooA/bLsSPuy8aJBa+Q/r34dMmC3KNL/zw==", + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.25.1.tgz", + "integrity": "sha512-iKPMh3H+0USHtWfZ1irfMTH6tGmIUFSnqt3E2K8BgI1VEsqiPh0RYkG2WTwzNiM1/WHN4FzYx/nrKR7PDHiRyw==", "license": "MIT", "dependencies": { - "@shikijs/types": "1.24.4", + "@shikijs/types": "1.25.1", "@shikijs/vscode-textmate": "^9.3.1" } }, + "node_modules/@shikijs/langs": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-1.25.1.tgz", + "integrity": "sha512-hdYjq9aRJplAzGe2qF51PR9IDgEoyGb4IkXvr3Ts6lEdg4Z8M/kdknKRo2EIuv3IR/aKkJXTlBQRM+wr3t20Ew==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "1.25.1" + } + }, + "node_modules/@shikijs/themes": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-1.25.1.tgz", + "integrity": "sha512-JO0lDn4LgGqg5QKvgich5ScUmC2okK+LxM9a3iLUH7YMeI2c8UGXThuJv6sZduS7pdJbYQHPrvWq9t/V4GhpbQ==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "1.25.1" + } + }, "node_modules/@shikijs/transformers": { - "version": "1.24.4", - "resolved": "https://registry.npmjs.org/@shikijs/transformers/-/transformers-1.24.4.tgz", - "integrity": "sha512-0jq5p9WLB7ToM/O7RWfxuIwirTJbIQsUR06jxdG3h3CEuO5m7ik8GnDsxwHhyIEfgJSZczSnVUZWFrNKy5It6g==", + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@shikijs/transformers/-/transformers-1.25.1.tgz", + "integrity": "sha512-uIwVJk9NnoHtEyF0zeL6kDygNh1FDkFXJvKOGieiilS1qa8KHtOwG2hGYOLkFjd2FRMhZSJKjOC94PCzY5xR+w==", "dev": true, "license": "MIT", "dependencies": { - "shiki": "1.24.4" + "shiki": "1.25.1" } }, "node_modules/@shikijs/types": { - "version": "1.24.4", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.24.4.tgz", - "integrity": "sha512-0r0XU7Eaow0PuDxuWC1bVqmWCgm3XqizIaT7SM42K03vc69LGooT0U8ccSR44xP/hGlNx4FKhtYpV+BU6aaKAA==", + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.25.1.tgz", + "integrity": "sha512-dceqFUoO95eY4tpOj3OGq8wE8EgJ4ey6Me1HQEu5UbwIYszFndEll/bjlB8Kp9wl4fx3uM7n4+y9XCYuDBmcXA==", "license": "MIT", "dependencies": { "@shikijs/vscode-textmate": "^9.3.1", @@ -2183,9 +2201,9 @@ } }, "node_modules/@types/node": { - "version": "22.10.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", - "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", + "version": "22.10.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.4.tgz", + "integrity": "sha512-99l6wv4HEzBQhvaU/UGoeBoCK61SCROQaCCGyQSgX2tEQ3rKkNZ2S7CEWnS/4s1LV+8ODdK21UeyR1fHP2mXug==", "devOptional": true, "license": "MIT", "dependencies": { @@ -2505,9 +2523,9 @@ } }, "node_modules/astro": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/astro/-/astro-5.1.1.tgz", - "integrity": "sha512-prpWC2PRs4P3FKQg6gZaU+VNMqbZi5pDvORGB2nrjfRjkrvF6/l4BqhvkJ6YQ0Ohm5rIMVz8ljgaRI77mLHbwg==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/astro/-/astro-5.1.2.tgz", + "integrity": "sha512-+U5lXPEJZ6cQx0botGbPhzN6XGWRgDtXgy/RUkpTmUj18LW6pbzYo0O0k3hFWOazlI039bZ+4P2e/oSNlKzm0Q==", "license": "MIT", "dependencies": { "@astrojs/compiler": "^2.10.3", @@ -4579,9 +4597,9 @@ } }, "node_modules/marked": { - "version": "15.0.4", - "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.4.tgz", - "integrity": "sha512-TCHvDqmb3ZJ4PWG7VEGVgtefA5/euFmsIhxtD0XsBxI39gUSKL81mIRFdt0AiNQozUahd4ke98ZdirExd/vSEw==", + "version": "15.0.5", + "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.5.tgz", + "integrity": "sha512-xN+kSuqHjxWg+Q47yhhZMUP+kO1qHobvXkkm6FX+7N6lDvanLDd8H7AQ0jWDDyq+fDt/cSrJaBGyWYHXy0KQWA==", "license": "MIT", "bin": { "marked": "bin/marked.js" @@ -5833,14 +5851,14 @@ } }, "node_modules/oniguruma-to-es": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-0.8.1.tgz", - "integrity": "sha512-dekySTEvCxCj0IgKcA2uUCO/e4ArsqpucDPcX26w9ajx+DvMWLc5eZeJaRQkd7oC/+rwif5gnT900tA34uN9Zw==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-0.10.0.tgz", + "integrity": "sha512-zapyOUOCJxt+xhiNRPPMtfJkHGsZ98HHB9qJEkdT8BGytO/+kpe4m1Ngf0MzbzTmhacn11w9yGeDP6tzDhnCdg==", "license": "MIT", "dependencies": { "emoji-regex-xs": "^1.0.0", - "regex": "^5.0.2", - "regex-recursion": "^5.0.0" + "regex": "^5.1.1", + "regex-recursion": "^5.1.1" } }, "node_modules/opendal": { @@ -5921,9 +5939,9 @@ } }, "node_modules/p-timeout": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.3.tgz", - "integrity": "sha512-UJUyfKbwvr/uZSV6btANfb+0t/mOhKV/KXcCUTp8FcQI+v/0d+wXqH4htrW0E4rR6WiEO/EPvUFiV9D5OI4vlw==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.4.tgz", + "integrity": "sha512-MyIV3ZA/PmyBN/ud8vV9XzwTrNtR4jFrObymZYnZqMmW0zA8Z17vnT0rBgFE/TlohB+YCHqXMgZzb3Csp49vqg==", "license": "MIT", "engines": { "node": ">=14.16" @@ -7171,15 +7189,17 @@ } }, "node_modules/shiki": { - "version": "1.24.4", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.24.4.tgz", - "integrity": "sha512-aVGSFAOAr1v26Hh/+GBIsRVDWJ583XYV7CuNURKRWh9gpGv4OdbisZGq96B9arMYTZhTQkmRF5BrShOSTvNqhw==", + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.25.1.tgz", + "integrity": "sha512-/1boRvNYwRW3GLG9Y6dXdnZ/Ha+J5T/5y3hV7TGQUcDSBM185D3FCbXlz2eTGNKG2iWCbWqo+P0yhGKZ4/CUrw==", "license": "MIT", "dependencies": { - "@shikijs/core": "1.24.4", - "@shikijs/engine-javascript": "1.24.4", - "@shikijs/engine-oniguruma": "1.24.4", - "@shikijs/types": "1.24.4", + "@shikijs/core": "1.25.1", + "@shikijs/engine-javascript": "1.25.1", + "@shikijs/engine-oniguruma": "1.25.1", + "@shikijs/langs": "1.25.1", + "@shikijs/themes": "1.25.1", + "@shikijs/types": "1.25.1", "@shikijs/vscode-textmate": "^9.3.1", "@types/hast": "^3.0.4" } @@ -7942,9 +7962,9 @@ } }, "node_modules/vite": { - "version": "6.0.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.6.tgz", - "integrity": "sha512-NSjmUuckPmDU18bHz7QZ+bTYhRR0iA72cs2QAxCqDpafJ0S6qetco0LB3WW2OxlMHS0JmAv+yZ/R3uPmMyGTjQ==", + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.7.tgz", + "integrity": "sha512-RDt8r/7qx9940f8FcOIAH9PTViRrghKaK2K1jY3RaAURrEUbm9Du1mJ72G+jlhtG3WwodnfzY8ORQZbBavZEAQ==", "license": "MIT", "dependencies": { "esbuild": "^0.24.2", @@ -8421,9 +8441,9 @@ } }, "node_modules/vitefu": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.4.tgz", - "integrity": "sha512-y6zEE3PQf6uu/Mt6DTJ9ih+kyJLr4XcSgHR2zUkM8SWDhuixEJxfJ6CZGMHh1Ec3vPLoEA0IHU5oWzVqw8ulow==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.5.tgz", + "integrity": "sha512-h4Vflt9gxODPFNGPwp4zAMZRpZR7eslzwH2c5hn5kNZ5rhnKyRJ50U+yGCdc2IRaBs8O4haIgLNGrV5CrpMsCA==", "license": "MIT", "workspaces": [ "tests/deps/*", diff --git a/package.json b/package.json index b5860cb..9587d97 100644 --- a/package.json +++ b/package.json @@ -44,14 +44,14 @@ "dependencies": { "@astrojs/mdx": "^4.0.3", "@astrojs/node": "^9.0.0", - "@astrojs/rss": "^4.0.10", - "astro": "^5.1.1", + "@astrojs/rss": "^4.0.11", + "astro": "^5.1.2", "drizzle-orm": "^0.38.3", "fuse.js": "^7.0.0", "glob": "^11.0.0", "lodash": "^4.17.21", "luxon": "^3.5.0", - "marked": "^15.0.4", + "marked": "^15.0.5", "pg": "^8.13.1", "pinyin-pro": "^3.26.0", "qrcode-svg": "^1.1.0", @@ -62,10 +62,10 @@ "@astrojs/check": "^0.9.4", "@biomejs/biome": "^1.9.4", "@napi-rs/canvas": "^0.1.65", - "@shikijs/transformers": "^1.24.4", + "@shikijs/transformers": "^1.25.1", "@types/lodash": "^4.17.13", "@types/luxon": "^3.4.2", - "@types/node": "^22.10.2", + "@types/node": "^22.10.4", "@types/pg": "^8.11.10", "@types/qrcode-svg": "^1.1.5", "@types/unist": "^3.0.3", diff --git a/src/pages/images/calendar/[year]/[time].jpg.ts b/src/pages/images/calendar/[year]/[time].jpg.ts index 199881e..6eec162 100644 --- a/src/pages/images/calendar/[year]/[time].jpg.ts +++ b/src/pages/images/calendar/[year]/[time].jpg.ts @@ -1,27 +1,10 @@ import type { APIRoute } from 'astro'; -import sharp from 'sharp'; const loadCalendarImage = async (year: string, time: string): Promise => { const link = `https://img.owspace.com/Public/uploads/Download/${year}/${time}.jpg`; - const response = await fetch(link, { + return await fetch(link, { referrer: '', }); - - if (!response.ok) { - console.error(`Failed to fetch image ${link}`); - return response; - } - - const croppedImage = await sharp(await response.arrayBuffer()) - .extract({ width: 1096, height: 1550, left: 90, top: 110 }) - .toBuffer(); - - return new Response(croppedImage, { - headers: { - 'Content-Type': 'image/jpeg', - 'Cache-Control': 'public, max-age=604800', - }, - }); }; const timeRegex = /\d{4}/;