diff --git a/app/p/[slug]/page.tsx b/app/p/[slug]/page.tsx index dcef78f..abffff8 100644 --- a/app/p/[slug]/page.tsx +++ b/app/p/[slug]/page.tsx @@ -1,3 +1,4 @@ +import '@catppuccin/highlightjs/sass/catppuccin.variables.scss'; import clsx from 'clsx'; import components from 'components/mdx/components'; import data from 'content/mdx-data'; @@ -6,11 +7,10 @@ import { SingleToc, generateToc } from 'lib/utils'; import { compileMDX } from 'next-mdx-remote/rsc'; import dynamic from 'next/dynamic'; import { notFound } from 'next/navigation'; +import rehypeHighlight from 'rehype-highlight'; import rehypeSlug from 'rehype-slug'; import remarkGfm from 'remark-gfm'; -import rehypeHighlight from 'rehype-highlight'; import { Post } from 'types'; -import '@catppuccin/highlightjs/sass/catppuccin.variables.scss'; const PostToc = dynamic(() => import('components/post/post-toc')); const PostCommnetLine = dynamic( diff --git a/components/pages/gists/gists-code.tsx b/components/pages/gists/gists-code.tsx index 321c4de..450fde5 100644 --- a/components/pages/gists/gists-code.tsx +++ b/components/pages/gists/gists-code.tsx @@ -1,14 +1,15 @@ +import '@catppuccin/highlightjs/sass/catppuccin.variables.scss'; import clsx from 'clsx'; +import CopyCode from 'components/post/copy-code'; import { createElement, Fragment, memo } from 'react'; +import rehypeHighlight from 'rehype-highlight'; import rehypeReact from 'rehype-react'; import remarkGfm from 'remark-gfm'; import remarkParse from 'remark-parse'; import remarkRehype from 'remark-rehype'; -import rehypeHighlight from 'rehype-highlight'; import { GistsFile } from 'types'; import { unified } from 'unified'; import styles from './gists-code.module.css'; -import '@catppuccin/highlightjs/sass/catppuccin.variables.scss'; interface Props { file: GistsFile; @@ -77,10 +78,16 @@ const GistsCode = ({ file, showFileName = false }: Props) => { -
{code}
+
+ {code} + +
) : ( -
{code}
+
+ {code} + +
)} ); diff --git a/components/post/copy-button.tsx b/components/post/copy-button.tsx index 6aee28c..bcd2687 100644 --- a/components/post/copy-button.tsx +++ b/components/post/copy-button.tsx @@ -25,8 +25,8 @@ const CopyButton = forwardRef( className={clsx( 'flex items-center justify-center', 'border rounded-md', - 'p-[6px] invisible', - 'group-hover:visible', + 'p-[6px] opacity-0', + 'group-hover:opacity-100', 'transition-opacity dark:border-gray-700', 'duration-300', className, diff --git a/content/posts/public-key-cryptgraphy.mdx b/content/posts/public-key-cryptgraphy.mdx index c16ed22..ea97e81 100644 --- a/content/posts/public-key-cryptgraphy.mdx +++ b/content/posts/public-key-cryptgraphy.mdx @@ -155,7 +155,7 @@ trust 如果有小伙伴想和我扮演 Tom and Jerry 的话,或者想校验我的签名的文件的话。欢迎使用下述公钥 -[我的公钥 🔒!](https://1drv.ms/u/s!ArC4gW7Dc7wWhd5PD8R_o6Mmhp2LxA?e=Ivpa8X) + ## 参考