From b00382f1cc684b48d08d995070270adfa80ed4c7 Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Wed, 17 Aug 2022 13:57:57 +0300 Subject: [PATCH] feat: render articles with multiple translations --- README.md | 2 +- package-lock.json | 557 ++++++------------- package.json | 12 +- src/components/ArticleItem/ArticleItem.scss | 4 + src/components/ArticleItem/ArticleItem.tsx | 15 +- src/components/ArticlePost/ArticlePost.astro | 3 +- src/i18n/utils.ts | 37 +- src/pages/blog/[...slug].astro | 10 +- src/templates/Articles.astro | 9 +- src/templates/Home.astro | 8 +- src/types/main.d.ts | 1 + src/utils/articles.ts | 1 + 12 files changed, 238 insertions(+), 421 deletions(-) diff --git a/README.md b/README.md index bc6f887..03c82cc 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ Personal website created with Astro. - [x] Adaptive & Responsive layout - [x] Search articles by title or description - [x] Dark/Light Theme +- [x] Form handling via Netlify Forms - [ ] Multilang web-site -- [ ] Form handling via Netlify Forms - [ ] SEO optimized ## License diff --git a/package-lock.json b/package-lock.json index ce4ff7b..168978c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,15 +10,15 @@ "license": "MIT", "devDependencies": { "@astrojs/image": "^0.3.4", - "@astrojs/mdx": "^0.9.0", + "@astrojs/mdx": "^0.10.0", "@astrojs/solid-js": "^1.0.0", "@types/mdx": "^2.0.2", - "@typescript-eslint/eslint-plugin": "^5.33.0", - "@typescript-eslint/parser": "^5.33.0", - "astro": "^1.0.4", - "astro-compress": "^0.0.18", + "@typescript-eslint/eslint-plugin": "^5.33.1", + "@typescript-eslint/parser": "^5.33.1", + "astro": "^1.0.6", + "astro-compress": "^0.0.19", "astro-icon": "^0.7.3", - "eslint": "^8.21.0", + "eslint": "^8.22.0", "eslint-plugin-solid": "^0.7.1", "hast-util-to-string": "^2.0.0", "hastscript": "^7.0.2", @@ -130,9 +130,9 @@ } }, "node_modules/@astrojs/mdx": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-0.9.0.tgz", - "integrity": "sha512-Z6W7YvCc36BenJZGkcG0oFi01OswR6KhUDWXL06prhgu51YSlKrpcvpykruGXaDQb1YkqGi3yxmWAmQwzgx6pQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-0.10.0.tgz", + "integrity": "sha512-nQcYzjPB8p0KWyP8g/8V6Rnxd7+5/VzNP4JLvQWUFs6mo7Akq98y4i+QjOl9/k5erzikl96Uul70MS/rjBheNQ==", "dev": true, "dependencies": { "@astrojs/prism": "^1.0.1", @@ -145,7 +145,6 @@ "rehype-raw": "^6.1.1", "remark-frontmatter": "^4.0.1", "remark-gfm": "^3.0.1", - "remark-shiki-twoslash": "^3.1.0", "remark-smartypants": "^2.0.0", "shiki": "^0.10.1", "unist-util-visit": "^4.1.0", @@ -1046,14 +1045,14 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.0.tgz", - "integrity": "sha512-jHvZNSW2WZ31OPJ3enhLrEKvAZNyAFWZ6rx9tUwaessTc4sx9KmgMNhVcqVAl1ETnT5rU5fpXTLmY9YvC1DCNg==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.1.tgz", + "integrity": "sha512-S1iZIxrTvKkU3+m63YUOxYPKaP+yWDQrdhxTglVDVEVBf+aCSw85+BmJnyUaQQsk5TXFG/LpBu9fa+LrAQ91fQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.33.0", - "@typescript-eslint/type-utils": "5.33.0", - "@typescript-eslint/utils": "5.33.0", + "@typescript-eslint/scope-manager": "5.33.1", + "@typescript-eslint/type-utils": "5.33.1", + "@typescript-eslint/utils": "5.33.1", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", @@ -1094,14 +1093,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.33.0.tgz", - "integrity": "sha512-cgM5cJrWmrDV2KpvlcSkelTBASAs1mgqq+IUGKJvFxWrapHpaRy5EXPQz9YaKF3nZ8KY18ILTiVpUtbIac86/w==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.33.1.tgz", + "integrity": "sha512-IgLLtW7FOzoDlmaMoXdxG8HOCByTBXrB1V2ZQYSEV1ggMmJfAkMWTwUjjzagS6OkfpySyhKFkBw7A9jYmcHpZA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.33.0", - "@typescript-eslint/types": "5.33.0", - "@typescript-eslint/typescript-estree": "5.33.0", + "@typescript-eslint/scope-manager": "5.33.1", + "@typescript-eslint/types": "5.33.1", + "@typescript-eslint/typescript-estree": "5.33.1", "debug": "^4.3.4" }, "engines": { @@ -1121,13 +1120,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.33.0.tgz", - "integrity": "sha512-/Jta8yMNpXYpRDl8EwF/M8It2A9sFJTubDo0ATZefGXmOqlaBffEw0ZbkbQ7TNDK6q55NPHFshGBPAZvZkE8Pw==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.33.1.tgz", + "integrity": "sha512-8ibcZSqy4c5m69QpzJn8XQq9NnqAToC8OdH/W6IXPXv83vRyEDPYLdjAlUx8h/rbusq6MkW4YdQzURGOqsn3CA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.33.0", - "@typescript-eslint/visitor-keys": "5.33.0" + "@typescript-eslint/types": "5.33.1", + "@typescript-eslint/visitor-keys": "5.33.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1138,12 +1137,12 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.33.0.tgz", - "integrity": "sha512-2zB8uEn7hEH2pBeyk3NpzX1p3lF9dKrEbnXq1F7YkpZ6hlyqb2yZujqgRGqXgRBTHWIUG3NGx/WeZk224UKlIA==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.33.1.tgz", + "integrity": "sha512-X3pGsJsD8OiqhNa5fim41YtlnyiWMF/eKsEZGsHID2HcDqeSC5yr/uLOeph8rNF2/utwuI0IQoAK3fpoxcLl2g==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "5.33.0", + "@typescript-eslint/utils": "5.33.1", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -1164,9 +1163,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.33.0.tgz", - "integrity": "sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.33.1.tgz", + "integrity": "sha512-7K6MoQPQh6WVEkMrMW5QOA5FO+BOwzHSNd0j3+BlBwd6vtzfZceJ8xJ7Um2XDi/O3umS8/qDX6jdy2i7CijkwQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1177,13 +1176,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.0.tgz", - "integrity": "sha512-tqq3MRLlggkJKJUrzM6wltk8NckKyyorCSGMq4eVkyL5sDYzJJcMgZATqmF8fLdsWrW7OjjIZ1m9v81vKcaqwQ==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.1.tgz", + "integrity": "sha512-JOAzJ4pJ+tHzA2pgsWQi4804XisPHOtbvwUyqsuuq8+y5B5GMZs7lI1xDWs6V2d7gE/Ez5bTGojSK12+IIPtXA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.33.0", - "@typescript-eslint/visitor-keys": "5.33.0", + "@typescript-eslint/types": "5.33.1", + "@typescript-eslint/visitor-keys": "5.33.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1219,15 +1218,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.33.0.tgz", - "integrity": "sha512-JxOAnXt9oZjXLIiXb5ZIcZXiwVHCkqZgof0O8KPgz7C7y0HS42gi75PdPlqh1Tf109M0fyUw45Ao6JLo7S5AHw==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.33.1.tgz", + "integrity": "sha512-uphZjkMaZ4fE8CR4dU7BquOV6u0doeQAr8n6cQenl/poMaIyJtBu8eys5uk6u5HiDH01Mj5lzbJ5SfeDz7oqMQ==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.33.0", - "@typescript-eslint/types": "5.33.0", - "@typescript-eslint/typescript-estree": "5.33.0", + "@typescript-eslint/scope-manager": "5.33.1", + "@typescript-eslint/types": "5.33.1", + "@typescript-eslint/typescript-estree": "5.33.1", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -1243,12 +1242,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.0.tgz", - "integrity": "sha512-/XsqCzD4t+Y9p5wd9HZiptuGKBlaZO5showwqODii5C0nZawxWLF+Q6k5wYHBrQv96h6GYKyqqMHCSTqta8Kiw==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.1.tgz", + "integrity": "sha512-nwIxOK8Z2MPWltLKMLOEZwmfBZReqUdbEoHQXeCpa+sRVARe5twpJGHCB4dk9903Yaf0nMAlGbQfaAH92F60eg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.33.0", + "@typescript-eslint/types": "5.33.1", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -1259,35 +1258,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript/twoslash": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@typescript/twoslash/-/twoslash-3.1.0.tgz", - "integrity": "sha512-kTwMUQ8xtAZaC4wb2XuLkPqFVBj2dNBueMQ89NWEuw87k2nLBbuafeG5cob/QEr6YduxIdTVUjix0MtC7mPlmg==", - "dev": true, - "dependencies": { - "@typescript/vfs": "1.3.5", - "debug": "^4.1.1", - "lz-string": "^1.4.4" - } - }, - "node_modules/@typescript/twoslash/node_modules/@typescript/vfs": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.3.5.tgz", - "integrity": "sha512-pI8Saqjupf9MfLw7w2+og+fmb0fZS0J6vsKXXrp4/PDXEFvntgzXmChCXC/KefZZS0YGS6AT8e0hGAJcTsdJlg==", - "dev": true, - "dependencies": { - "debug": "^4.1.1" - } - }, - "node_modules/@typescript/vfs": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.3.4.tgz", - "integrity": "sha512-RbyJiaAGQPIcAGWFa3jAXSuAexU4BFiDRF1g3hy7LmRqfNpYlTQWGXjcrOaVZjJ8YkkpuwG0FcsYvtWQpd9igQ==", - "dev": true, - "dependencies": { - "debug": "^4.1.1" - } - }, "node_modules/@vscode/emmet-helper": { "version": "2.8.4", "resolved": "https://registry.npmjs.org/@vscode/emmet-helper/-/emmet-helper-2.8.4.tgz", @@ -1498,9 +1468,9 @@ } }, "node_modules/astro": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/astro/-/astro-1.0.4.tgz", - "integrity": "sha512-wNXmDSHnhiFcEeMy2VWMJV1i8mPx8Lu4qLBfZSmP9nWrc/oxgBZfDQTWOj0/NFu+MkfZ2JEGJlL9RZFmHrKlew==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/astro/-/astro-1.0.6.tgz", + "integrity": "sha512-QAkdkzP3PbauiO4YnOgVTWY6z26heKruoXW9TnN8Bbmwtf7DUFIchi6CFSAVYSONX8XtRnj+p6fCkk06OWfJ4w==", "dev": true, "dependencies": { "@astrojs/compiler": "^0.23.3", @@ -1568,15 +1538,15 @@ } }, "node_modules/astro-compress": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/astro-compress/-/astro-compress-0.0.18.tgz", - "integrity": "sha512-6AaT8vlJkXYyImIQ70+bCkPTPfgSfvw3T+S9AOlSv65GFf1pZBuhO5nRuCg2jtEVBw4Eo/T4qC9khYbd6cVsWA==", + "version": "0.0.19", + "resolved": "https://registry.npmjs.org/astro-compress/-/astro-compress-0.0.19.tgz", + "integrity": "sha512-Hgv1wX43vOwzUNuqRm7hbCMUXoH2xF+kTjBR+6RqAbM6hjqIlB8aKEGOVdELj6BiwnMDLf1dl6C1TmYPPgDMAg==", "dev": true, "dependencies": { "csso": "5.0.5", "deepmerge-ts": "4.2.1", "fast-glob": "3.2.11", - "html-minifier-terser": "6.1.0", + "html-minifier-terser": "7.0.0", "sharp": "0.30.7", "svgo": "2.8.0", "terser": "5.14.2" @@ -2069,9 +2039,9 @@ "dev": true }, "node_modules/clean-css": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.1.tgz", - "integrity": "sha512-lCr8OHhiWCTw4v8POJovCoh4T7I9U11yVsPjMWWnnMmp9ZowCxyad1Pathle/9HjaDp+fdQKjO9fQydE6RHTZg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.0.tgz", + "integrity": "sha512-2639sWGa43EMmG7fn8mdVuBSs6HuWaSor+ZPoFWzenBc6oN+td8YhTfghWXZ25G1NiiSvz8bOFBS7PdSbTiqEA==", "dev": true, "dependencies": { "source-map": "~0.6.0" @@ -2204,12 +2174,12 @@ } }, "node_modules/commander": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.0.tgz", + "integrity": "sha512-sRPT+umqkz90UA8M1yqYfnHlZA7fF6nSphDtxeywPZ49ysjxDQybzk13CL+mXekDRG92skbcqCLVovuCusNmFw==", "dev": true, "engines": { - "node": ">= 12" + "node": "^12.20.0 || >=14" } }, "node_modules/common-ancestor-path": { @@ -3041,9 +3011,9 @@ } }, "node_modules/eslint": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.21.0.tgz", - "integrity": "sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.22.0.tgz", + "integrity": "sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.3.0", @@ -3610,15 +3580,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/fenceparser": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/fenceparser/-/fenceparser-1.1.1.tgz", - "integrity": "sha512-VdkTsK7GWLT0VWMK5S5WTAPn61wJ98WPFwJiRHumhg4ESNUO/tnkU8bzzzc62o6Uk1SVhuZFLnakmDA4SGV7wA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/fetch-blob": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", @@ -4300,15 +4261,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "bin": { - "he": "bin/he" - } - }, "node_modules/html-entities": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.3.tgz", @@ -4322,24 +4274,36 @@ "dev": true }, "node_modules/html-minifier-terser": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", - "integrity": "sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-7.0.0.tgz", + "integrity": "sha512-Adqk0b/pWKIQiGvEAuzPKpBKNHiwblr3QSGS7TTr6v+xXKV9AI2k4vWW+6Oytt6Z5SeBnfvYypKOnz8r75pz3Q==", "dev": true, "dependencies": { "camel-case": "^4.1.2", - "clean-css": "^5.2.2", - "commander": "^8.3.0", - "he": "^1.2.0", + "clean-css": "5.2.0", + "commander": "^9.4.0", + "entities": "^4.3.1", "param-case": "^3.0.4", "relateurl": "^0.2.7", - "terser": "^5.10.0" + "terser": "^5.14.2" }, "bin": { "html-minifier-terser": "cli.js" }, "engines": { - "node": ">=12" + "node": "^14.13.1 || >=16.0.0" + } + }, + "node_modules/html-minifier-terser/node_modules/entities": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.1.tgz", + "integrity": "sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" } }, "node_modules/html-tags": { @@ -5143,15 +5107,6 @@ "node": ">=10" } }, - "node_modules/lz-string": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz", - "integrity": "sha512-0ckx7ZHRPqb0oUm8zNr+90mtf9DQB60H1wMCjBtfi62Kl3a7JbHob6gA2bC+xRvZoOL+1hzUK8jeuEIQE8svEQ==", - "dev": true, - "bin": { - "lz-string": "bin/bin.js" - } - }, "node_modules/magic-string": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", @@ -7252,12 +7207,6 @@ "node": ">=0.10.0" } }, - "node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", - "dev": true - }, "node_modules/regexp.prototype.flags": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", @@ -7473,68 +7422,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-shiki-twoslash": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/remark-shiki-twoslash/-/remark-shiki-twoslash-3.1.0.tgz", - "integrity": "sha512-6LqSqVtHQR4S0DKfdQ2/ePn9loTKUtpyopYvwk8johjDTeUW5MkaLQuZHlWNkkST/4aMbz6aTkstIcwfwcHpXg==", - "dev": true, - "dependencies": { - "@typescript/twoslash": "3.1.0", - "@typescript/vfs": "1.3.4", - "fenceparser": "^1.1.0", - "regenerator-runtime": "^0.13.7", - "shiki": "0.10.1", - "shiki-twoslash": "3.1.0", - "tslib": "2.1.0", - "typescript": ">3", - "unist-util-visit": "^2.0.0" - } - }, - "node_modules/remark-shiki-twoslash/node_modules/tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==", - "dev": true - }, - "node_modules/remark-shiki-twoslash/node_modules/unist-util-is": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", - "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-shiki-twoslash/node_modules/unist-util-visit": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", - "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", - "dev": true, - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0", - "unist-util-visit-parents": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-shiki-twoslash/node_modules/unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", - "dev": true, - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/remark-smartypants": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-2.0.0.tgz", @@ -7930,18 +7817,6 @@ "vscode-textmate": "5.2.0" } }, - "node_modules/shiki-twoslash": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/shiki-twoslash/-/shiki-twoslash-3.1.0.tgz", - "integrity": "sha512-uDqrTutOIZzyHbo103GsK7Vvc10saK1XCCivnOQ1NHJzgp3FBilEpftGeVzVSMOJs+JyhI7whkvhXV7kXQ5zCg==", - "dev": true, - "dependencies": { - "@typescript/twoslash": "3.1.0", - "@typescript/vfs": "1.3.4", - "shiki": "0.10.1", - "typescript": ">3" - } - }, "node_modules/shiki/node_modules/jsonc-parser": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.1.0.tgz", @@ -8673,6 +8548,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "dev": true, + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9412,9 +9288,9 @@ } }, "@astrojs/mdx": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-0.9.0.tgz", - "integrity": "sha512-Z6W7YvCc36BenJZGkcG0oFi01OswR6KhUDWXL06prhgu51YSlKrpcvpykruGXaDQb1YkqGi3yxmWAmQwzgx6pQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-0.10.0.tgz", + "integrity": "sha512-nQcYzjPB8p0KWyP8g/8V6Rnxd7+5/VzNP4JLvQWUFs6mo7Akq98y4i+QjOl9/k5erzikl96Uul70MS/rjBheNQ==", "dev": true, "requires": { "@astrojs/prism": "^1.0.1", @@ -9427,7 +9303,6 @@ "rehype-raw": "^6.1.1", "remark-frontmatter": "^4.0.1", "remark-gfm": "^3.0.1", - "remark-shiki-twoslash": "^3.1.0", "remark-smartypants": "^2.0.0", "shiki": "^0.10.1", "unist-util-visit": "^4.1.0", @@ -10149,14 +10024,14 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.0.tgz", - "integrity": "sha512-jHvZNSW2WZ31OPJ3enhLrEKvAZNyAFWZ6rx9tUwaessTc4sx9KmgMNhVcqVAl1ETnT5rU5fpXTLmY9YvC1DCNg==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.1.tgz", + "integrity": "sha512-S1iZIxrTvKkU3+m63YUOxYPKaP+yWDQrdhxTglVDVEVBf+aCSw85+BmJnyUaQQsk5TXFG/LpBu9fa+LrAQ91fQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.33.0", - "@typescript-eslint/type-utils": "5.33.0", - "@typescript-eslint/utils": "5.33.0", + "@typescript-eslint/scope-manager": "5.33.1", + "@typescript-eslint/type-utils": "5.33.1", + "@typescript-eslint/utils": "5.33.1", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", @@ -10177,52 +10052,52 @@ } }, "@typescript-eslint/parser": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.33.0.tgz", - "integrity": "sha512-cgM5cJrWmrDV2KpvlcSkelTBASAs1mgqq+IUGKJvFxWrapHpaRy5EXPQz9YaKF3nZ8KY18ILTiVpUtbIac86/w==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.33.1.tgz", + "integrity": "sha512-IgLLtW7FOzoDlmaMoXdxG8HOCByTBXrB1V2ZQYSEV1ggMmJfAkMWTwUjjzagS6OkfpySyhKFkBw7A9jYmcHpZA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.33.0", - "@typescript-eslint/types": "5.33.0", - "@typescript-eslint/typescript-estree": "5.33.0", + "@typescript-eslint/scope-manager": "5.33.1", + "@typescript-eslint/types": "5.33.1", + "@typescript-eslint/typescript-estree": "5.33.1", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.33.0.tgz", - "integrity": "sha512-/Jta8yMNpXYpRDl8EwF/M8It2A9sFJTubDo0ATZefGXmOqlaBffEw0ZbkbQ7TNDK6q55NPHFshGBPAZvZkE8Pw==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.33.1.tgz", + "integrity": "sha512-8ibcZSqy4c5m69QpzJn8XQq9NnqAToC8OdH/W6IXPXv83vRyEDPYLdjAlUx8h/rbusq6MkW4YdQzURGOqsn3CA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.33.0", - "@typescript-eslint/visitor-keys": "5.33.0" + "@typescript-eslint/types": "5.33.1", + "@typescript-eslint/visitor-keys": "5.33.1" } }, "@typescript-eslint/type-utils": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.33.0.tgz", - "integrity": "sha512-2zB8uEn7hEH2pBeyk3NpzX1p3lF9dKrEbnXq1F7YkpZ6hlyqb2yZujqgRGqXgRBTHWIUG3NGx/WeZk224UKlIA==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.33.1.tgz", + "integrity": "sha512-X3pGsJsD8OiqhNa5fim41YtlnyiWMF/eKsEZGsHID2HcDqeSC5yr/uLOeph8rNF2/utwuI0IQoAK3fpoxcLl2g==", "dev": true, "requires": { - "@typescript-eslint/utils": "5.33.0", + "@typescript-eslint/utils": "5.33.1", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.33.0.tgz", - "integrity": "sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.33.1.tgz", + "integrity": "sha512-7K6MoQPQh6WVEkMrMW5QOA5FO+BOwzHSNd0j3+BlBwd6vtzfZceJ8xJ7Um2XDi/O3umS8/qDX6jdy2i7CijkwQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.0.tgz", - "integrity": "sha512-tqq3MRLlggkJKJUrzM6wltk8NckKyyorCSGMq4eVkyL5sDYzJJcMgZATqmF8fLdsWrW7OjjIZ1m9v81vKcaqwQ==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.1.tgz", + "integrity": "sha512-JOAzJ4pJ+tHzA2pgsWQi4804XisPHOtbvwUyqsuuq8+y5B5GMZs7lI1xDWs6V2d7gE/Ez5bTGojSK12+IIPtXA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.33.0", - "@typescript-eslint/visitor-keys": "5.33.0", + "@typescript-eslint/types": "5.33.1", + "@typescript-eslint/visitor-keys": "5.33.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -10242,60 +10117,29 @@ } }, "@typescript-eslint/utils": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.33.0.tgz", - "integrity": "sha512-JxOAnXt9oZjXLIiXb5ZIcZXiwVHCkqZgof0O8KPgz7C7y0HS42gi75PdPlqh1Tf109M0fyUw45Ao6JLo7S5AHw==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.33.1.tgz", + "integrity": "sha512-uphZjkMaZ4fE8CR4dU7BquOV6u0doeQAr8n6cQenl/poMaIyJtBu8eys5uk6u5HiDH01Mj5lzbJ5SfeDz7oqMQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.33.0", - "@typescript-eslint/types": "5.33.0", - "@typescript-eslint/typescript-estree": "5.33.0", + "@typescript-eslint/scope-manager": "5.33.1", + "@typescript-eslint/types": "5.33.1", + "@typescript-eslint/typescript-estree": "5.33.1", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/visitor-keys": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.0.tgz", - "integrity": "sha512-/XsqCzD4t+Y9p5wd9HZiptuGKBlaZO5showwqODii5C0nZawxWLF+Q6k5wYHBrQv96h6GYKyqqMHCSTqta8Kiw==", + "version": "5.33.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.1.tgz", + "integrity": "sha512-nwIxOK8Z2MPWltLKMLOEZwmfBZReqUdbEoHQXeCpa+sRVARe5twpJGHCB4dk9903Yaf0nMAlGbQfaAH92F60eg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.33.0", + "@typescript-eslint/types": "5.33.1", "eslint-visitor-keys": "^3.3.0" } }, - "@typescript/twoslash": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@typescript/twoslash/-/twoslash-3.1.0.tgz", - "integrity": "sha512-kTwMUQ8xtAZaC4wb2XuLkPqFVBj2dNBueMQ89NWEuw87k2nLBbuafeG5cob/QEr6YduxIdTVUjix0MtC7mPlmg==", - "dev": true, - "requires": { - "@typescript/vfs": "1.3.5", - "debug": "^4.1.1", - "lz-string": "^1.4.4" - }, - "dependencies": { - "@typescript/vfs": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.3.5.tgz", - "integrity": "sha512-pI8Saqjupf9MfLw7w2+og+fmb0fZS0J6vsKXXrp4/PDXEFvntgzXmChCXC/KefZZS0YGS6AT8e0hGAJcTsdJlg==", - "dev": true, - "requires": { - "debug": "^4.1.1" - } - } - } - }, - "@typescript/vfs": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.3.4.tgz", - "integrity": "sha512-RbyJiaAGQPIcAGWFa3jAXSuAexU4BFiDRF1g3hy7LmRqfNpYlTQWGXjcrOaVZjJ8YkkpuwG0FcsYvtWQpd9igQ==", - "dev": true, - "requires": { - "debug": "^4.1.1" - } - }, "@vscode/emmet-helper": { "version": "2.8.4", "resolved": "https://registry.npmjs.org/@vscode/emmet-helper/-/emmet-helper-2.8.4.tgz", @@ -10458,9 +10302,9 @@ "dev": true }, "astro": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/astro/-/astro-1.0.4.tgz", - "integrity": "sha512-wNXmDSHnhiFcEeMy2VWMJV1i8mPx8Lu4qLBfZSmP9nWrc/oxgBZfDQTWOj0/NFu+MkfZ2JEGJlL9RZFmHrKlew==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/astro/-/astro-1.0.6.tgz", + "integrity": "sha512-QAkdkzP3PbauiO4YnOgVTWY6z26heKruoXW9TnN8Bbmwtf7DUFIchi6CFSAVYSONX8XtRnj+p6fCkk06OWfJ4w==", "dev": true, "requires": { "@astrojs/compiler": "^0.23.3", @@ -10538,15 +10382,15 @@ } }, "astro-compress": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/astro-compress/-/astro-compress-0.0.18.tgz", - "integrity": "sha512-6AaT8vlJkXYyImIQ70+bCkPTPfgSfvw3T+S9AOlSv65GFf1pZBuhO5nRuCg2jtEVBw4Eo/T4qC9khYbd6cVsWA==", + "version": "0.0.19", + "resolved": "https://registry.npmjs.org/astro-compress/-/astro-compress-0.0.19.tgz", + "integrity": "sha512-Hgv1wX43vOwzUNuqRm7hbCMUXoH2xF+kTjBR+6RqAbM6hjqIlB8aKEGOVdELj6BiwnMDLf1dl6C1TmYPPgDMAg==", "dev": true, "requires": { "csso": "5.0.5", "deepmerge-ts": "4.2.1", "fast-glob": "3.2.11", - "html-minifier-terser": "6.1.0", + "html-minifier-terser": "7.0.0", "sharp": "0.30.7", "svgo": "2.8.0", "terser": "5.14.2" @@ -10875,9 +10719,9 @@ "dev": true }, "clean-css": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.1.tgz", - "integrity": "sha512-lCr8OHhiWCTw4v8POJovCoh4T7I9U11yVsPjMWWnnMmp9ZowCxyad1Pathle/9HjaDp+fdQKjO9fQydE6RHTZg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.0.tgz", + "integrity": "sha512-2639sWGa43EMmG7fn8mdVuBSs6HuWaSor+ZPoFWzenBc6oN+td8YhTfghWXZ25G1NiiSvz8bOFBS7PdSbTiqEA==", "dev": true, "requires": { "source-map": "~0.6.0" @@ -10977,9 +10821,9 @@ "dev": true }, "commander": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.0.tgz", + "integrity": "sha512-sRPT+umqkz90UA8M1yqYfnHlZA7fF6nSphDtxeywPZ49ysjxDQybzk13CL+mXekDRG92skbcqCLVovuCusNmFw==", "dev": true }, "common-ancestor-path": { @@ -11508,9 +11352,9 @@ "dev": true }, "eslint": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.21.0.tgz", - "integrity": "sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.22.0.tgz", + "integrity": "sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA==", "dev": true, "requires": { "@eslint/eslintrc": "^1.3.0", @@ -11935,12 +11779,6 @@ "format": "^0.2.0" } }, - "fenceparser": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/fenceparser/-/fenceparser-1.1.1.tgz", - "integrity": "sha512-VdkTsK7GWLT0VWMK5S5WTAPn61wJ98WPFwJiRHumhg4ESNUO/tnkU8bzzzc62o6Uk1SVhuZFLnakmDA4SGV7wA==", - "dev": true - }, "fetch-blob": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", @@ -12454,12 +12292,6 @@ "space-separated-tokens": "^2.0.0" } }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, "html-entities": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.3.tgz", @@ -12473,18 +12305,26 @@ "dev": true }, "html-minifier-terser": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", - "integrity": "sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-7.0.0.tgz", + "integrity": "sha512-Adqk0b/pWKIQiGvEAuzPKpBKNHiwblr3QSGS7TTr6v+xXKV9AI2k4vWW+6Oytt6Z5SeBnfvYypKOnz8r75pz3Q==", "dev": true, "requires": { "camel-case": "^4.1.2", - "clean-css": "^5.2.2", - "commander": "^8.3.0", - "he": "^1.2.0", + "clean-css": "5.2.0", + "commander": "^9.4.0", + "entities": "^4.3.1", "param-case": "^3.0.4", "relateurl": "^0.2.7", - "terser": "^5.10.0" + "terser": "^5.14.2" + }, + "dependencies": { + "entities": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.1.tgz", + "integrity": "sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==", + "dev": true + } } }, "html-tags": { @@ -13029,12 +12869,6 @@ "yallist": "^4.0.0" } }, - "lz-string": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz", - "integrity": "sha512-0ckx7ZHRPqb0oUm8zNr+90mtf9DQB60H1wMCjBtfi62Kl3a7JbHob6gA2bC+xRvZoOL+1hzUK8jeuEIQE8svEQ==", - "dev": true - }, "magic-string": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", @@ -14478,12 +14312,6 @@ } } }, - "regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", - "dev": true - }, "regexp.prototype.flags": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", @@ -14640,58 +14468,6 @@ "unified": "^10.0.0" } }, - "remark-shiki-twoslash": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/remark-shiki-twoslash/-/remark-shiki-twoslash-3.1.0.tgz", - "integrity": "sha512-6LqSqVtHQR4S0DKfdQ2/ePn9loTKUtpyopYvwk8johjDTeUW5MkaLQuZHlWNkkST/4aMbz6aTkstIcwfwcHpXg==", - "dev": true, - "requires": { - "@typescript/twoslash": "3.1.0", - "@typescript/vfs": "1.3.4", - "fenceparser": "^1.1.0", - "regenerator-runtime": "^0.13.7", - "shiki": "0.10.1", - "shiki-twoslash": "3.1.0", - "tslib": "2.1.0", - "typescript": ">3", - "unist-util-visit": "^2.0.0" - }, - "dependencies": { - "tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==", - "dev": true - }, - "unist-util-is": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", - "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", - "dev": true - }, - "unist-util-visit": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", - "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", - "dev": true, - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0", - "unist-util-visit-parents": "^3.0.0" - } - }, - "unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", - "dev": true, - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" - } - } - } - }, "remark-smartypants": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-2.0.0.tgz", @@ -14984,18 +14760,6 @@ } } }, - "shiki-twoslash": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/shiki-twoslash/-/shiki-twoslash-3.1.0.tgz", - "integrity": "sha512-uDqrTutOIZzyHbo103GsK7Vvc10saK1XCCivnOQ1NHJzgp3FBilEpftGeVzVSMOJs+JyhI7whkvhXV7kXQ5zCg==", - "dev": true, - "requires": { - "@typescript/twoslash": "3.1.0", - "@typescript/vfs": "1.3.4", - "shiki": "0.10.1", - "typescript": ">3" - } - }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -15520,7 +15284,8 @@ "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", - "dev": true + "dev": true, + "peer": true }, "unbox-primitive": { "version": "1.0.2", diff --git a/package.json b/package.json index d95414a..11808cc 100644 --- a/package.json +++ b/package.json @@ -20,15 +20,15 @@ }, "devDependencies": { "@astrojs/image": "^0.3.4", - "@astrojs/mdx": "^0.9.0", + "@astrojs/mdx": "^0.10.0", "@astrojs/solid-js": "^1.0.0", "@types/mdx": "^2.0.2", - "@typescript-eslint/eslint-plugin": "^5.33.0", - "@typescript-eslint/parser": "^5.33.0", - "astro": "^1.0.4", - "astro-compress": "^0.0.18", + "@typescript-eslint/eslint-plugin": "^5.33.1", + "@typescript-eslint/parser": "^5.33.1", + "astro": "^1.0.6", + "astro-compress": "^0.0.19", "astro-icon": "^0.7.3", - "eslint": "^8.21.0", + "eslint": "^8.22.0", "eslint-plugin-solid": "^0.7.1", "hast-util-to-string": "^2.0.0", "hastscript": "^7.0.2", diff --git a/src/components/ArticleItem/ArticleItem.scss b/src/components/ArticleItem/ArticleItem.scss index c3cf57c..94116ee 100644 --- a/src/components/ArticleItem/ArticleItem.scss +++ b/src/components/ArticleItem/ArticleItem.scss @@ -8,6 +8,10 @@ column-gap: 10px; color: var(--font-color); padding: 8px 0; + & sup { + margin-left: 5px; + font-size: 0.7em; + } & h3 { font-size: var(--font-size-md); font-weight: normal; diff --git a/src/components/ArticleItem/ArticleItem.tsx b/src/components/ArticleItem/ArticleItem.tsx index 9fd136d..5104f33 100644 --- a/src/components/ArticleItem/ArticleItem.tsx +++ b/src/components/ArticleItem/ArticleItem.tsx @@ -1,6 +1,8 @@ +/* eslint-disable solid/reactivity */ import type { Component } from "solid-js"; import { createDateFormatter } from "@utils/date"; import "./ArticleItem.scss"; +import { DEFAULT_LANGUAGE } from "@root/config"; export type ArticleItemProps = { data: ArticleType; @@ -8,14 +10,17 @@ export type ArticleItemProps = { }; export const ArticleItem: Component = (props) => { - // eslint-disable-next-line solid/reactivity - const DateFormatter = createDateFormatter(props.lang); + const isNonDefaultLanguage = props.data.lang && props.data.lang !== props.lang; + const hrefLangPrefix = props.data.lang && props.data.lang !== DEFAULT_LANGUAGE ? "/en" : ""; return ( diff --git a/src/components/ArticlePost/ArticlePost.astro b/src/components/ArticlePost/ArticlePost.astro index 1b9da09..844456d 100644 --- a/src/components/ArticlePost/ArticlePost.astro +++ b/src/components/ArticlePost/ArticlePost.astro @@ -11,7 +11,6 @@ export type Props = { const { data, lang } = Astro.props as Props; const { title, tags, author, published_at } = data; -const DateFormatter = createDateFormatter("ru"); ---
@@ -31,7 +30,7 @@ const DateFormatter = createDateFormatter("ru");

{title}

- + {author}
{ diff --git a/src/i18n/utils.ts b/src/i18n/utils.ts index 482a25f..f1f2566 100644 --- a/src/i18n/utils.ts +++ b/src/i18n/utils.ts @@ -1,8 +1,43 @@ -import type { AstroGlobal } from "astro"; +import type { AstroGlobal, MDXInstance } from "astro"; import * as utils from "@utils/url"; import { DEFAULT_LANGUAGE } from "@root/config"; import languages from "./languages"; +export function getTranslatedArticles(Astro: Readonly): MDXInstance[] { + const data = import.meta.glob>("../../content/articles/**/*.mdx", { eager: true }); + const modules: Record>> = {}; + const siteLang = utils.getLanguageFromURL(Astro.url.pathname); + const articles: MDXInstance[] = []; + + for (const module of Object.values(data)) { + const splitted = module.file.split("/"); + const lang = splitted.at(-2); + const name = splitted.at(-3); + if (!modules[name]) modules[name] = {}; + modules[name][lang] = module; + } + + for (const key of Object.keys(modules)) { + const langs = Object.keys(modules[key]); + for (const articleLang of langs) { + const isNonDefaultLanguage = !langs.includes(siteLang) && langs.length === 1; + const article = modules[key]; + + if (articleLang === siteLang) { + articles.push(article[siteLang]); + article[siteLang].frontmatter.lang = siteLang; + } + + if (isNonDefaultLanguage) { + articles.push(article[articleLang]); + article[articleLang].frontmatter.lang = articleLang; + } + } + } + + return articles; +} + export function getLanguageKeys(): Array { return Object.keys(languages); } diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index 83925fc..c5e3834 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -3,14 +3,20 @@ import type { MDXInstance } from "astro"; import ArticleLayout from "@layouts/article.astro"; import { getLanguageFromURL } from "@root/utils"; +import { DEFAULT_LANGUAGE } from "@root/config"; const lang = getLanguageFromURL(Astro.url.pathname); export async function getStaticPaths() { + const modules = import.meta.glob>("../../../content/articles/**/*.mdx", { eager: true }); + const entries = Object.keys(modules).map((key) => [key, key.split("/").slice(7)[0]]); const data = await Astro.glob("../../../content/articles/**/*.mdx"); - return data.map((article) => { + + return entries.map(([key, lang]) => { + const article = modules[key]; const published_at = new Date(article.frontmatter.published_at).toLocaleDateString("en-CA"); - const slug = `${published_at}/${article.frontmatter.slug}`; + const slug = `${published_at}/${lang !== DEFAULT_LANGUAGE ? lang + "/" : ""}${article.frontmatter.slug}`; + return { params: { slug }, props: article }; }); } diff --git a/src/templates/Articles.astro b/src/templates/Articles.astro index 7af8d69..7ce1421 100644 --- a/src/templates/Articles.astro +++ b/src/templates/Articles.astro @@ -3,12 +3,13 @@ import PageLayout from "@layouts/default.astro"; import ArticlesList from "@components/ArticlesList"; import { transformArticles, formatToArticleBlocks } from "@utils/articles"; import { getLanguageFromURL } from "@root/utils"; -import { useTranslation } from "@i18n/utils"; +import { useTranslation, getTranslatedArticles } from "@i18n/utils"; const t = useTranslation(Astro); -const articles = await Astro.glob("../../content/articles/**/*.mdx"); -const tags = new Set(articles.map((article) => article.frontmatter.tags).flat()); +const data = getTranslatedArticles(Astro); +const tags = new Set(data.map((article) => article.frontmatter.tags).flat()); const lang = getLanguageFromURL(Astro.url.pathname); +const articles = transformArticles(data); --- @@ -20,7 +21,7 @@ const lang = getLanguageFromURL(Astro.url.pathname); "input.search": t("input.search"), "articles.empty": t("articles.empty"), }} - data={{ articles: formatToArticleBlocks(transformArticles(articles)), tags: [...tags] }} + data={{ articles: formatToArticleBlocks(articles), tags: [...tags] }} /> diff --git a/src/templates/Home.astro b/src/templates/Home.astro index 4b5b394..a94b881 100644 --- a/src/templates/Home.astro +++ b/src/templates/Home.astro @@ -4,13 +4,13 @@ import PageLayout from "@layouts/default.astro"; import RecentArticles from "@components/RecentArticles"; import { Splash, SplashHeading, SplashLinks, Link } from "@components/Splash"; import { getLanguageFromURL } from "@root/utils"; -import { useTranslation } from "@i18n/utils"; +import { getTranslatedArticles, useTranslation } from "@i18n/utils"; import UIString from "@components/UIString"; -const data = await Astro.glob("../../content/articles/**/*.mdx"); -const articles = utils.transformArticles(data); +const data = getTranslatedArticles(Astro); const t = useTranslation(Astro); const lang = getLanguageFromURL(Astro.url.pathname); +const articles = utils.transformArticles(data); --- @@ -27,5 +27,5 @@ const lang = getLanguageFromURL(Astro.url.pathname); - + diff --git a/src/types/main.d.ts b/src/types/main.d.ts index ee96d48..07e13bb 100644 --- a/src/types/main.d.ts +++ b/src/types/main.d.ts @@ -38,6 +38,7 @@ declare global { author: string; tags: Array; published_at: string; + lang?: string; }; type ProjectType = { diff --git a/src/utils/articles.ts b/src/utils/articles.ts index 60b8155..7ea06ce 100644 --- a/src/utils/articles.ts +++ b/src/utils/articles.ts @@ -8,6 +8,7 @@ export const transformArticles = (articles: MDXInstance[]): Article author: article.frontmatter.author, tags: article.frontmatter.tags, published_at: article.frontmatter.published_at, + lang: article.frontmatter.lang, })); export const sortArtcilesByDate = (articles: ArticleType[]): ArticleType[] => {