feat: add tex(?) formula support

This commit is contained in:
草师傅 2025-07-10 18:05:41 +08:00
parent 414cd7d3d7
commit d6e1a9dd94
Signed by: gb
GPG key ID: 43330A030E2D6478
5 changed files with 145 additions and 1 deletions

View file

@ -9,6 +9,7 @@ import ReplyViaEmail from "../../components/ReplyViaEmail.astro";
import { ExtractFirstImage } from '../../plugins/extract-images';
import AuthorInfo from "../../components/helper/authors/Info.astro";
import TableOfContents from "../../components/TableOfContents.astro";
import "katex/dist/katex.css"
export async function getStaticPaths() {
const blogEntries = await getCollection('posts');
@ -62,6 +63,11 @@ const cover = customFeaturedImage || matchedImage_src?.src || firstImageURL || `
<br>
<a href="/blog">&larr; Back to posts</a>
{noscript && <h2>Comments</h2> <Comments path={`blog/${slug}`} />}
{!noscript &&
<script>
import "katex/dist/contrib/copy-tex.js"
</script>
}
</div>
</Layout>