fix: code blocks rendering + consistent styling with ciphera-website /learn

- Convert MDX CodeBlock components to standard markdown code fences
- Add rehype-mdx-code-props to pass filename meta to code components
- Custom pre/code MDX components map fences to CodeBlock
- Add brand color badges (product + category) matching /learn layout
- Match prose styling: orange inline code, orange links, white strong
- Remove brand color background glow (not in /learn)
This commit is contained in:
Usman Baig
2026-03-29 01:01:56 +01:00
parent a992afe04b
commit 627613dc13
30 changed files with 235 additions and 79 deletions

View File

@@ -16,7 +16,8 @@ The best way to add Pulse to your Next.js application is using the built-in `nex
Add the Pulse script to your root layout so it loads on every page.
<CodeBlock filename="app/layout.tsx">{`import Script from 'next/script'
```tsx filename="app/layout.tsx"
import Script from 'next/script'
export default function RootLayout({
children,
@@ -36,13 +37,15 @@ export default function RootLayout({
<body>{children}</body>
</html>
)
}`}</CodeBlock>
}
```
## Method 2: Pages Router
If you're using the Pages Router, add the script to your custom `_app.tsx`.
<CodeBlock filename="pages/_app.tsx">{`import Script from 'next/script'
```tsx filename="pages/_app.tsx"
import Script from 'next/script'
import type { AppProps } from 'next/app'
export default function App({ Component, pageProps }: AppProps) {
@@ -57,7 +60,8 @@ export default function App({ Component, pageProps }: AppProps) {
<Component {...pageProps} />
</>
)
}`}</CodeBlock>
}
```
## Configuration options