feat: upgrade unified, rewrite unified pipeline, rehype ipfs

This commit is contained in:
DIYgod
2024-01-17 13:16:09 +08:00
parent b23ebf266f
commit 251e183cd7
8 changed files with 830 additions and 912 deletions
+2 -6
View File
@@ -9,12 +9,8 @@ import { CharacterFloatCard } from "../common/CharacterFloatCard"
import { UniLink } from "./UniLink"
const getSiteId = ({ id, children }: { id: string; children?: any }) => {
if (
children?.[0] &&
typeof children[0] === "string" &&
children[0].startsWith("@")
) {
return children[0].replace(/^@/, "")
if (children && typeof children === "string" && children.startsWith("@")) {
return children.replace(/^@/, "")
} else if (id) {
return id.replace(/^user-content-/, "")
}