From f497f3536a423fe16d4885f3b3ad990881f3b449 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Fri, 8 Sep 2023 05:10:52 -0500 Subject: [PATCH] compiler? --- package-lock.json | 28 +- package.json | 1 + src/components/JsCode.astro | 7 + src/components/TocWrapper.astro | 11 +- .../posts/2023-09-08-compiler/CodeBlock.astro | 48 ++++ .../2023-09-08-compiler/Playground.astro | 33 +++ .../posts/2023-09-08-compiler/index.mdx | 244 ++++++++++++++++++ .../posts/2023-09-08-compiler/style.scss | 4 + src/pages/posts/[...slug].astro | 22 +- src/styles/_colors.scss | 26 ++ src/styles/_variables.scss | 2 +- src/styles/toc.scss | 2 +- tsconfig.json | 3 +- 13 files changed, 412 insertions(+), 19 deletions(-) create mode 100644 src/components/JsCode.astro create mode 100644 src/content/posts/2023-09-08-compiler/CodeBlock.astro create mode 100644 src/content/posts/2023-09-08-compiler/Playground.astro create mode 100644 src/content/posts/2023-09-08-compiler/index.mdx create mode 100644 src/content/posts/2023-09-08-compiler/style.scss diff --git a/package-lock.json b/package-lock.json index 006c08e..32c9078 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "katex": "^0.16.8", "lodash-es": "^4.17.21", "mdast-util-to-string": "^4.0.0", + "nanoid": "^4.0.2", "reading-time": "^1.5.0", "rehype-katex": "^6.0.3", "remark-emoji": "^4.0.0", @@ -5976,9 +5977,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz", + "integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==", "funding": [ { "type": "github", @@ -5986,10 +5987,10 @@ } ], "bin": { - "nanoid": "bin/nanoid.cjs" + "nanoid": "bin/nanoid.js" }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": "^14 || ^16 || >=18" } }, "node_modules/napi-build-utils": { @@ -6489,6 +6490,23 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/postcss/node_modules/nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/potrace": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/potrace/-/potrace-2.1.8.tgz", diff --git a/package.json b/package.json index b558986..bbbf2b1 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "katex": "^0.16.8", "lodash-es": "^4.17.21", "mdast-util-to-string": "^4.0.0", + "nanoid": "^4.0.2", "reading-time": "^1.5.0", "rehype-katex": "^6.0.3", "remark-emoji": "^4.0.0", diff --git a/src/components/JsCode.astro b/src/components/JsCode.astro new file mode 100644 index 0000000..f312b31 --- /dev/null +++ b/src/components/JsCode.astro @@ -0,0 +1,7 @@ +--- +interface Props {} + +const {} = Astro.props; +console.log("SHIET", Astro.props); +console.log("SHIET", await Astro.slots.render("default")); +--- diff --git a/src/components/TocWrapper.astro b/src/components/TocWrapper.astro index c268629..3476794 100644 --- a/src/components/TocWrapper.astro +++ b/src/components/TocWrapper.astro @@ -20,10 +20,17 @@ const minDepth = Math.min(...headings.map((heading) => heading.depth));

Table of contents