diff --git a/astro.config.mjs b/astro.config.mjs index 002886c..1168d9a 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,17 +1,36 @@ +import rehypePrettyCode from "rehype-pretty-code"; import { defineConfig } from "astro/config"; import partytown from "@astrojs/partytown"; import tailwind from "@astrojs/tailwind"; import sitemap from "@astrojs/sitemap"; import compress from "astro-compress"; +import remarkToc from "remark-toc"; import mdx from "@astrojs/mdx"; +const options = { + theme: "one-dark-pro", + onVisitLine(node) { + // Prevent lines from collapsing in `display: grid` mode, and allow empty lines to be copy/pasted + if (node.children.length === 0) { + node.children = [{ type: "text", value: " " }]; + } + }, + onVisitHighlightedLine(node) { + node.properties.className.push("highlighted"); + }, + onVisitHighlightedWord(node) { + node.properties.className = ["word"]; + }, +}; + // https://astro.build/config export default defineConfig({ site: "https://nir.galons.io", integrations: [sitemap(), tailwind({ config: { applyBaseStyles: false } }), partytown(), mdx(), compress()], markdown: { - shikiConfig: { - theme: "dracula-soft", - }, + rehypePlugins: [[rehypePrettyCode, options]], + syntaxHighlight: false, + remarkPlugins: [remarkToc], + extendDefaultPlugins: true, // Preserve Astro's default plugins: GitHub-flavored Markdown and Smartypants }, }); diff --git a/package-lock.json b/package-lock.json index cc068b4..b75b8c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,8 @@ "algoliasearch": "^4.14.2", "astro": "^1.2.6", "astro-compress": "^1.0.12", + "rehype-pretty-code": "^0.4.0", + "remark-toc": "^8.0.1", "tailwindcss": "^3.1.8" }, "devDependencies": { @@ -1318,6 +1320,16 @@ "@types/estree": "*" } }, + "node_modules/@types/extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/extend/-/extend-3.0.1.tgz", + "integrity": "sha512-R1g/VyKFFI2HLC1QGAeTtCBWCo6n75l41OnsVYNbmKG+kempOESaodf6BeJyUM3Q0rKa/NQcTHbB2+66lNnxLw==" + }, + "node_modules/@types/github-slugger": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@types/github-slugger/-/github-slugger-1.3.0.tgz", + "integrity": "sha512-J/rMZa7RqiH/rT29TEVZO4nBoDP9XJOjnbbIofg7GQKs4JIduEO3WLpte+6WeUz/TcrXKlY+bM7FYrp8yFB+3g==" + }, "node_modules/@types/hast": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.4.tgz", @@ -5309,6 +5321,52 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-toc": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-toc/-/mdast-util-toc-6.1.0.tgz", + "integrity": "sha512-0PuqZELXZl4ms1sF7Lqigrqik4Ll3UhbI+jdTrfw7pZ9QPawgl7LD4GQ8MkU7bT/EwiVqChNTbifa2jLLKo76A==", + "dependencies": { + "@types/extend": "^3.0.0", + "@types/github-slugger": "^1.0.0", + "@types/mdast": "^3.0.0", + "extend": "^3.0.0", + "github-slugger": "^1.0.0", + "mdast-util-to-string": "^3.1.0", + "unist-util-is": "^5.0.0", + "unist-util-visit": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-toc/node_modules/unist-util-visit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz", + "integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-toc/node_modules/unist-util-visit-parents": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz", + "integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdn-data": { "version": "2.0.28", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", @@ -6456,6 +6514,11 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/parse-numeric-range": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz", + "integrity": "sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==" + }, "node_modules/parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -7078,6 +7141,20 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/rehype-pretty-code": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/rehype-pretty-code/-/rehype-pretty-code-0.4.0.tgz", + "integrity": "sha512-Bp91nfo4blpgCXlvGP1hsG+kRFfjqBVU09o1RFcnNA62u+iIzJiJRGzpfBj4FaItq7CEQL5ASGB7vLxN5xCvyA==", + "dependencies": { + "parse-numeric-range": "^1.3.0" + }, + "engines": { + "node": "^12.16.0 || >=13.2.0" + }, + "peerDependencies": { + "shiki": "*" + } + }, "node_modules/rehype-raw": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-6.1.1.tgz", @@ -7230,6 +7307,20 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-toc": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/remark-toc/-/remark-toc-8.0.1.tgz", + "integrity": "sha512-7he2VOm/cy13zilnOTZcyAoyoolV26ULlon6XyCFU+vG54Z/LWJnwphj/xKIDLOt66QmJUgTyUvLVHi2aAElyg==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-toc": "^6.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -10412,6 +10503,16 @@ "@types/estree": "*" } }, + "@types/extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/extend/-/extend-3.0.1.tgz", + "integrity": "sha512-R1g/VyKFFI2HLC1QGAeTtCBWCo6n75l41OnsVYNbmKG+kempOESaodf6BeJyUM3Q0rKa/NQcTHbB2+66lNnxLw==" + }, + "@types/github-slugger": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@types/github-slugger/-/github-slugger-1.3.0.tgz", + "integrity": "sha512-J/rMZa7RqiH/rT29TEVZO4nBoDP9XJOjnbbIofg7GQKs4JIduEO3WLpte+6WeUz/TcrXKlY+bM7FYrp8yFB+3g==" + }, "@types/hast": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.4.tgz", @@ -13200,6 +13301,42 @@ "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz", "integrity": "sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA==" }, + "mdast-util-toc": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-toc/-/mdast-util-toc-6.1.0.tgz", + "integrity": "sha512-0PuqZELXZl4ms1sF7Lqigrqik4Ll3UhbI+jdTrfw7pZ9QPawgl7LD4GQ8MkU7bT/EwiVqChNTbifa2jLLKo76A==", + "requires": { + "@types/extend": "^3.0.0", + "@types/github-slugger": "^1.0.0", + "@types/mdast": "^3.0.0", + "extend": "^3.0.0", + "github-slugger": "^1.0.0", + "mdast-util-to-string": "^3.1.0", + "unist-util-is": "^5.0.0", + "unist-util-visit": "^3.0.0" + }, + "dependencies": { + "unist-util-visit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz", + "integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==", + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^4.0.0" + } + }, + "unist-util-visit-parents": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz", + "integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==", + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + } + } + } + }, "mdn-data": { "version": "2.0.28", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", @@ -13917,6 +14054,11 @@ "unist-util-visit-children": "^1.0.0" } }, + "parse-numeric-range": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz", + "integrity": "sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==" + }, "parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -14336,6 +14478,14 @@ "unified": "^10.0.0" } }, + "rehype-pretty-code": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/rehype-pretty-code/-/rehype-pretty-code-0.4.0.tgz", + "integrity": "sha512-Bp91nfo4blpgCXlvGP1hsG+kRFfjqBVU09o1RFcnNA62u+iIzJiJRGzpfBj4FaItq7CEQL5ASGB7vLxN5xCvyA==", + "requires": { + "parse-numeric-range": "^1.3.0" + } + }, "rehype-raw": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-6.1.1.tgz", @@ -14446,6 +14596,16 @@ "unified": "^10.0.0" } }, + "remark-toc": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/remark-toc/-/remark-toc-8.0.1.tgz", + "integrity": "sha512-7he2VOm/cy13zilnOTZcyAoyoolV26ULlon6XyCFU+vG54Z/LWJnwphj/xKIDLOt66QmJUgTyUvLVHi2aAElyg==", + "requires": { + "@types/mdast": "^3.0.0", + "mdast-util-toc": "^6.0.0", + "unified": "^10.0.0" + } + }, "require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", diff --git a/package.json b/package.json index d29e8e2..732ee11 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,8 @@ "algoliasearch": "^4.14.2", "astro": "^1.2.6", "astro-compress": "^1.0.12", + "rehype-pretty-code": "^0.4.0", + "remark-toc": "^8.0.1", "tailwindcss": "^3.1.8" }, "devDependencies": { diff --git a/public/posts/2022/github-email/contributions-heat-map.webp b/public/posts/2022/github-email/contributions-heat-map.webp deleted file mode 100644 index 3885801..0000000 Binary files a/public/posts/2022/github-email/contributions-heat-map.webp and /dev/null differ diff --git a/public/posts/2022/github-email/github-contributions-graph.webp b/public/posts/2022/github-email/github-contributions-graph.webp new file mode 100644 index 0000000..e2b886f Binary files /dev/null and b/public/posts/2022/github-email/github-contributions-graph.webp differ diff --git a/public/posts/2022/github-email/github-private-email.webp b/public/posts/2022/github-email/github-private-email.webp new file mode 100644 index 0000000..a2b39b0 Binary files /dev/null and b/public/posts/2022/github-email/github-private-email.webp differ diff --git a/public/posts/2022/github-email/google-email.webp b/public/posts/2022/github-email/google-email.webp new file mode 100644 index 0000000..25e7493 Binary files /dev/null and b/public/posts/2022/github-email/google-email.webp differ diff --git a/public/terminal-dots.svg b/public/terminal-dots.svg new file mode 100644 index 0000000..5eef600 --- /dev/null +++ b/public/terminal-dots.svg @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/src/components/Header.astro b/src/components/Header.astro index 96a6914..aa8a39e 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,18 +1,44 @@ -
CONTENTS
-1. Request a Quota
-2. Create the VM
-3. Install CUDA and Hashcat
-4. Let's get down to business
-5. Summary
+ { + headings.map((header: Record<"depth" | "slug" | "text", string>) => ( + + {header.text} + + )) + }