From 334e6cb1bf03c92c2f76ef4a9023c5cd8a90a9cc Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Wed, 4 Oct 2023 09:16:04 -0500 Subject: [PATCH] add edit history --- astro.config.ts | 3 ++- package-lock.json | 36 +++++++++++++++++++++++++++++++++ package.json | 1 + src/pages/posts/[...slug].astro | 7 +++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/astro.config.ts b/astro.config.ts index 8fb0870..49ad6ba 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -2,6 +2,7 @@ import { defineConfig } from "astro/config"; import mdx from "@astrojs/mdx"; import sitemap from "@astrojs/sitemap"; import { astroImageTools } from "astro-imagetools"; +import { rehypeAccessibleEmojis } from "rehype-accessible-emojis"; import remarkReadingTime from "./plugin/remark-reading-time"; import emoji from "remark-emoji"; @@ -27,6 +28,6 @@ export default defineConfig({ emoji, [remarkDescription, { name: "excerpt" }], ], - rehypePlugins: [rehypeKatex], + rehypePlugins: [rehypeKatex, rehypeAccessibleEmojis], }, }); diff --git a/package-lock.json b/package-lock.json index 32c9078..43e1351 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "mdast-util-to-string": "^4.0.0", "nanoid": "^4.0.2", "reading-time": "^1.5.0", + "rehype-accessible-emojis": "^0.3.2", "rehype-katex": "^6.0.3", "remark-emoji": "^4.0.0", "remark-github-beta-blockquote-admonitions": "^2.1.0", @@ -3577,6 +3578,11 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, + "node_modules/gemoji": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/gemoji/-/gemoji-4.2.1.tgz", + "integrity": "sha512-V9lUpRSn+KQGavZx8Pk+6mxG3kaz21ae2kTCXuT36KaRPNgYU8eHtj/RcUCNFVvmwppsYYz3nnNS9lmcP5kTsg==" + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -6924,6 +6930,31 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/rehype-accessible-emojis": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/rehype-accessible-emojis/-/rehype-accessible-emojis-0.3.2.tgz", + "integrity": "sha512-kChZo+EZsuFQYHUPu6kOZFjDrG7UtQdGxkrCvHBVo9ariKPL6S68QdPVxLxwcAtZSRZIXZhDuTJHgIM8KW24Qw==", + "dependencies": { + "emoji-regex": "^8.0.0", + "gemoji": "^4.2.1", + "hast-util-is-element": "^1.0.3", + "unist-util-flatmap": "^1.0.0" + } + }, + "node_modules/rehype-accessible-emojis/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/rehype-accessible-emojis/node_modules/hast-util-is-element": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-1.1.0.tgz", + "integrity": "sha512-oUmNua0bFbdrD/ELDSSEadRVtWZOf3iF6Lbv81naqsIV99RnSCieTbWuWCY8BAeEfKJTKl0gRdokv+dELutHGQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/rehype-katex": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/rehype-katex/-/rehype-katex-6.0.3.tgz", @@ -8415,6 +8446,11 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/unist-util-flatmap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unist-util-flatmap/-/unist-util-flatmap-1.0.0.tgz", + "integrity": "sha512-IG32jcKJlhARCYT2LsYPJWdoXYkzz3ESAdl1aa2hn9Auh+cgUmU6wgkII4yCc/1GgeWibRdELdCZh/p3QKQ1dQ==" + }, "node_modules/unist-util-generated": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.1.tgz", diff --git a/package.json b/package.json index bbbf2b1..a3e14c9 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "mdast-util-to-string": "^4.0.0", "nanoid": "^4.0.2", "reading-time": "^1.5.0", + "rehype-accessible-emojis": "^0.3.2", "rehype-katex": "^6.0.3", "remark-emoji": "^4.0.0", "remark-github-beta-blockquote-admonitions": "^2.1.0", diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro index 4d5c3f7..e7e3bd9 100644 --- a/src/pages/posts/[...slug].astro +++ b/src/pages/posts/[...slug].astro @@ -73,6 +73,13 @@ const excerpt = remarkPluginFrontmatter.excerpt?.replaceAll("\n", ""); Posted on - {remarkPluginFrontmatter.minutesRead} + - + Edit History + {