feat: add github alerts support (#1095)

This commit is contained in:
Stephen Zhou
2023-12-01 21:31:08 +08:00
committed by GitHub
parent 55db2992b7
commit bb98256042
4 changed files with 26 additions and 11 deletions
+4 -1
View File
@@ -24,6 +24,9 @@ import Providers, { mantineDefaultColorScheme, mantineTheme } from "./providers"
import "@crossbell/connect-kit/colors.css"
import "@mantine/core/styles.css"
import "remark-github-alerts/styles/github-colors-light.css"
import "remark-github-alerts/styles/github-colors-dark-class.css"
import "remark-github-alerts/styles/github-base.css"
import "~/css/main.css"
export const metadata: Metadata = {
@@ -125,7 +128,7 @@ export default async function RootLayout({
const messages = await getMessages()
return (
<html lang={params.locale} className={colorScheme}>
<html lang={params.locale} className={colorScheme} suppressHydrationWarning>
<head>
<ColorSchemeInjector />
<ColorSchemeScript />
+3
View File
@@ -24,6 +24,7 @@ import remarkDirectiveRehype from "remark-directive-rehype"
import emoji from "remark-emoji"
import remarkFrontmatter from "remark-frontmatter"
import remarkGfm from "remark-gfm"
import remarkGithubAlerts from "remark-github-alerts"
import remarkMath from "remark-math"
import remarkParse from "remark-parse"
import remarkRehype from "remark-rehype"
@@ -104,6 +105,8 @@ export const renderPageContent = (
try {
let pipeline = unified()
.use(remarkParse)
// make sure this is before remarkBreaks
.use(remarkGithubAlerts)
.use(remarkBreaks)
.use(remarkFrontmatter, ["yaml"])
.use(() => (tree: Root) => {