This commit is contained in:
parent
b36a272815
commit
334e6cb1bf
4 changed files with 46 additions and 1 deletions
|
@ -2,6 +2,7 @@ import { defineConfig } from "astro/config";
|
||||||
import mdx from "@astrojs/mdx";
|
import mdx from "@astrojs/mdx";
|
||||||
import sitemap from "@astrojs/sitemap";
|
import sitemap from "@astrojs/sitemap";
|
||||||
import { astroImageTools } from "astro-imagetools";
|
import { astroImageTools } from "astro-imagetools";
|
||||||
|
import { rehypeAccessibleEmojis } from "rehype-accessible-emojis";
|
||||||
|
|
||||||
import remarkReadingTime from "./plugin/remark-reading-time";
|
import remarkReadingTime from "./plugin/remark-reading-time";
|
||||||
import emoji from "remark-emoji";
|
import emoji from "remark-emoji";
|
||||||
|
@ -27,6 +28,6 @@ export default defineConfig({
|
||||||
emoji,
|
emoji,
|
||||||
[remarkDescription, { name: "excerpt" }],
|
[remarkDescription, { name: "excerpt" }],
|
||||||
],
|
],
|
||||||
rehypePlugins: [rehypeKatex],
|
rehypePlugins: [rehypeKatex, rehypeAccessibleEmojis],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
36
package-lock.json
generated
36
package-lock.json
generated
|
@ -22,6 +22,7 @@
|
||||||
"mdast-util-to-string": "^4.0.0",
|
"mdast-util-to-string": "^4.0.0",
|
||||||
"nanoid": "^4.0.2",
|
"nanoid": "^4.0.2",
|
||||||
"reading-time": "^1.5.0",
|
"reading-time": "^1.5.0",
|
||||||
|
"rehype-accessible-emojis": "^0.3.2",
|
||||||
"rehype-katex": "^6.0.3",
|
"rehype-katex": "^6.0.3",
|
||||||
"remark-emoji": "^4.0.0",
|
"remark-emoji": "^4.0.0",
|
||||||
"remark-github-beta-blockquote-admonitions": "^2.1.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",
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
|
"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": {
|
"node_modules/gensync": {
|
||||||
"version": "1.0.0-beta.2",
|
"version": "1.0.0-beta.2",
|
||||||
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
|
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
|
||||||
|
@ -6924,6 +6930,31 @@
|
||||||
"url": "https://opencollective.com/unified"
|
"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": {
|
"node_modules/rehype-katex": {
|
||||||
"version": "6.0.3",
|
"version": "6.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/rehype-katex/-/rehype-katex-6.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/rehype-katex/-/rehype-katex-6.0.3.tgz",
|
||||||
|
@ -8415,6 +8446,11 @@
|
||||||
"url": "https://opencollective.com/unified"
|
"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": {
|
"node_modules/unist-util-generated": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.1.tgz",
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
"mdast-util-to-string": "^4.0.0",
|
"mdast-util-to-string": "^4.0.0",
|
||||||
"nanoid": "^4.0.2",
|
"nanoid": "^4.0.2",
|
||||||
"reading-time": "^1.5.0",
|
"reading-time": "^1.5.0",
|
||||||
|
"rehype-accessible-emojis": "^0.3.2",
|
||||||
"rehype-katex": "^6.0.3",
|
"rehype-katex": "^6.0.3",
|
||||||
"remark-emoji": "^4.0.0",
|
"remark-emoji": "^4.0.0",
|
||||||
"remark-github-beta-blockquote-admonitions": "^2.1.0",
|
"remark-github-beta-blockquote-admonitions": "^2.1.0",
|
||||||
|
|
|
@ -73,6 +73,13 @@ const excerpt = remarkPluginFrontmatter.excerpt?.replaceAll("\n", "");
|
||||||
<small class="post-meta">
|
<small class="post-meta">
|
||||||
Posted on <Timestamp timestamp={post.data.date} />
|
Posted on <Timestamp timestamp={post.data.date} />
|
||||||
- {remarkPluginFrontmatter.minutesRead}
|
- {remarkPluginFrontmatter.minutesRead}
|
||||||
|
- <a
|
||||||
|
href={`https://git.mzhang.io/michael/blog/commits/branch/master/src/content/posts/${post.id}`}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
>
|
||||||
|
Edit History
|
||||||
|
</a>
|
||||||
</small>
|
</small>
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue