-
+
{post.data?.title ?? post.url}
{post.data?.description && (
@@ -239,15 +239,17 @@ export default async function Page({
{normalizeTag(post.data?.tags).length > 0 && (
- {normalizeTag(post.data.tags).slice(0, 3).map((tag) => (
-
- {tag}
-
- ))}
+ {normalizeTag(post.data.tags)
+ .slice(0, 3)
+ .map((tag) => (
+
+ {tag}
+
+ ))}
)}
diff --git a/apps/www/app/(docs)/docs/[[...slug]]/page.tsx b/apps/www/app/(docs)/docs/[[...slug]]/page.tsx
index 0be40074a..c5251a1be 100644
--- a/apps/www/app/(docs)/docs/[[...slug]]/page.tsx
+++ b/apps/www/app/(docs)/docs/[[...slug]]/page.tsx
@@ -55,9 +55,16 @@ export async function generateMetadata({
const url = process.env.NEXT_PUBLIC_APP_URL
- const ogUrl = new URL(`${url}/og`)
- ogUrl.searchParams.set("title", doc.title ?? "")
- ogUrl.searchParams.set("description", doc.description ?? "")
+ let ogUrl: URL | null = null
+ try {
+ if (url) {
+ ogUrl = new URL(`${url}/og`)
+ ogUrl.searchParams.set("title", doc.title ?? "")
+ ogUrl.searchParams.set("description", doc.description ?? "")
+ }
+ } catch {
+ // Invalid URL, will use default
+ }
return {
title: `${doc.title} | React Components & Templates`,
@@ -67,19 +74,21 @@ export async function generateMetadata({
description: doc.description,
type: "article",
url: absoluteUrl(page.url),
- images: [
- {
- url: ogUrl.toString(),
- width: 1200,
- height: 630,
- },
- ],
+ images: ogUrl
+ ? [
+ {
+ url: ogUrl.toString(),
+ width: 1200,
+ height: 630,
+ },
+ ]
+ : [],
},
twitter: {
card: "summary_large_image",
title: doc.title,
description: doc.description,
- images: [ogUrl.toString()],
+ images: ogUrl ? [ogUrl.toString()] : [],
creator: "@dillionverma",
},
}
diff --git a/apps/www/components/blog/table-of-contents.tsx b/apps/www/components/blog/table-of-contents.tsx
index 557b1e62d..6a65bca64 100644
--- a/apps/www/components/blog/table-of-contents.tsx
+++ b/apps/www/components/blog/table-of-contents.tsx
@@ -16,10 +16,10 @@ const generateHeadingId = (text: string) => {
.trim()
}
-export function BlogTableOfContents({
+export function BlogTableOfContents({
className,
onLinkClick,
-}: {
+}: {
className?: string
onLinkClick?: () => void
}) {
diff --git a/apps/www/components/docs-copy-page.tsx b/apps/www/components/docs-copy-page.tsx
index 33774c179..acc26a8c6 100644
--- a/apps/www/components/docs-copy-page.tsx
+++ b/apps/www/components/docs-copy-page.tsx
@@ -41,8 +41,8 @@ export function DocsCopyPage({ page, url }: { page: string; url: string }) {
let pathname = "/docs"
try {
pathname = new URL(url).pathname
- } catch (e) {
- console.error(e)
+ } catch {
+ // Invalid URL provided, using default pathname
}
const menuItems: Record
React.ReactNode> = {
viewMarkdown: () => {
diff --git a/apps/www/components/posthog-provider.tsx b/apps/www/components/posthog-provider.tsx
index f809492eb..c07e23bd4 100644
--- a/apps/www/components/posthog-provider.tsx
+++ b/apps/www/components/posthog-provider.tsx
@@ -5,8 +5,8 @@ import { usePathname, useSearchParams } from "next/navigation"
import posthog from "posthog-js"
import { PostHogProvider } from "posthog-js/react"
-if (typeof window !== "undefined") {
- posthog.init(process.env.NEXT_PUBLIC_POSTHOG_API_KEY!, {
+if (typeof window !== "undefined" && process.env.NEXT_PUBLIC_POSTHOG_API_KEY) {
+ posthog.init(process.env.NEXT_PUBLIC_POSTHOG_API_KEY, {
api_host: "https://app.posthog.com",
capture_pageview: true,
session_recording: {
diff --git a/apps/www/components/sidebar-cta.tsx b/apps/www/components/sidebar-cta.tsx
index 7e4a79ae5..267739a95 100644
--- a/apps/www/components/sidebar-cta.tsx
+++ b/apps/www/components/sidebar-cta.tsx
@@ -28,7 +28,20 @@ export function ProCTA() {
Faster
{" "}
- with Magic UI Pro
+ with{" "}
+
+ Magic UI Pro
+
Stop building from scratch.
Get{" "}
@@ -45,20 +58,20 @@ export function ProCTA() {
-
-
+
+
Next.js 15 + TypeScript ready
-
-
+
+
Copy, paste, customize in minutes
-
-
+
+
Save 100+ hours of development
diff --git a/apps/www/content/blog/typescript-vs-javascript-differences.mdx b/apps/www/content/blog/typescript-vs-javascript-differences.mdx
index 04ecda5d5..86d260d31 100644
--- a/apps/www/content/blog/typescript-vs-javascript-differences.mdx
+++ b/apps/www/content/blog/typescript-vs-javascript-differences.mdx
@@ -39,7 +39,7 @@ This comparison isn't about crowning a winner. It’s about helping you make the
-
+
|
|
-
+
|
Project Scope
|
@@ -73,7 +73,7 @@ This comparison isn't about crowning a winner. It’s about helping you make the
maintainability.
-
+
|
Error Detection
|
@@ -84,7 +84,7 @@ This comparison isn't about crowning a winner. It’s about helping you make the
Catches type-related errors during compilation, before code is run.
-
+
|
Developer Experience
|
diff --git a/apps/www/content/docs/components/highlighter.mdx b/apps/www/content/docs/components/highlighter.mdx
index e295c153b..18ec08a7b 100644
--- a/apps/www/content/docs/components/highlighter.mdx
+++ b/apps/www/content/docs/components/highlighter.mdx
@@ -51,7 +51,7 @@ import { Highlighter } from "@/components/ui/highlighter"
Magic UI Highlighter
{" "}
makes important{" "}
-
+
text stand out
{" "}
effortlessly.
diff --git a/apps/www/mdx-components.tsx b/apps/www/mdx-components.tsx
index 35f658e7c..94ef6cf06 100644
--- a/apps/www/mdx-components.tsx
+++ b/apps/www/mdx-components.tsx
@@ -100,10 +100,7 @@ export const mdxComponents = {
/>
),
p: ({ className, ...props }: React.ComponentProps<"p">) => (
-
+
),
strong: ({ className, ...props }: React.HTMLAttributes) => (
@@ -119,7 +116,10 @@ export const mdxComponents = {
),
blockquote: ({ className, ...props }: React.ComponentProps<"blockquote">) => (
),
@@ -128,40 +128,30 @@ export const mdxComponents = {
),
iframe: ({ className, ...props }: React.ComponentProps<"iframe">) => (
-
+
),
hr: ({ className, ...props }: React.ComponentProps<"hr">) => (
-
+
),
table: ({ className, ...props }: React.ComponentProps<"table">) => (
),
thead: ({ className, ...props }: React.ComponentProps<"thead">) => (
-
+
),
tr: ({ className, ...props }: React.ComponentProps<"tr">) => (
{" "}
makes important{" "}
-
+
text stand out
{" "}
effortlessly.
diff --git a/apps/www/public/r/highlighter-demo.json b/apps/www/public/r/highlighter-demo.json
index a8234c0d1..b97ea7566 100644
--- a/apps/www/public/r/highlighter-demo.json
+++ b/apps/www/public/r/highlighter-demo.json
@@ -13,7 +13,7 @@
"files": [
{
"path": "registry/example/highlighter-demo.tsx",
- "content": "import { Highlighter } from \"@/registry/magicui/highlighter\"\n\nexport default function HighlighterDemo() {\n return (\n \n
\n The{\" \"}\n \n Magic UI Highlighter\n {\" \"}\n makes important{\" \"}\n \n text stand out\n {\" \"}\n effortlessly.\n
\n
\n )\n}\n",
+ "content": "import { Highlighter } from \"@/registry/magicui/highlighter\"\n\nexport default function HighlighterDemo() {\n return (\n \n
\n The{\" \"}\n \n Magic UI Highlighter\n {\" \"}\n makes important{\" \"}\n \n text stand out\n {\" \"}\n effortlessly.\n
\n
\n )\n}\n",
"type": "registry:example"
},
{
diff --git a/apps/www/registry/example/highlighter-demo.tsx b/apps/www/registry/example/highlighter-demo.tsx
index 314e8118a..bd24c6781 100644
--- a/apps/www/registry/example/highlighter-demo.tsx
+++ b/apps/www/registry/example/highlighter-demo.tsx
@@ -9,7 +9,7 @@ export default function HighlighterDemo() {
Magic UI Highlighter
{" "}
makes important{" "}
-
+
text stand out
{" "}
effortlessly.
diff --git a/fix_code.py b/fix_code.py
new file mode 100644
index 000000000..bf04d97d7
--- /dev/null
+++ b/fix_code.py
@@ -0,0 +1,70 @@
+with open("apps/www/content/blog/create-next-js-app.mdx", "r") as f:
+ content = f.read()
+
+# Find and replace the unquoted code block
+old = """Let's say you're building a sleek, modern dashboard. You can easily extend the default theme to include your specific brand colors.
+
+// tailwind.config.ts
+import type { Config } from 'tailwindcss';
+
+const config: Config = {
+content: [
+'./pages/**/*.{js,ts,jsx,tsx,mdx}',
+'./components/**/*.{js,ts,jsx,tsx,mdx}',
+'./app/**/*.{js,ts,jsx,tsx,mdx}',
+],
+theme: {
+extend: {
+colors: {
+brand: {
+primary: '#0A72E4',
+secondary: '#F5A623',
+},
+dark: {
+900: '#1a1a1a',
+800: '#2b2b2b',
+},
+},
+},
+},
+plugins: [],
+};
+export default config;"""
+
+new = """Let's say you're building a sleek, modern dashboard. You can easily extend the default theme to include your specific brand colors.
+
+```typescript
+// tailwind.config.ts
+import type { Config } from 'tailwindcss';
+
+const config: Config = {
+ content: [
+ './pages/**/*.{js,ts,jsx,tsx,mdx}',
+ './components/**/*.{js,ts,jsx,tsx,mdx}',
+ './app/**/*.{js,ts,jsx,tsx,mdx}',
+ ],
+ theme: {
+ extend: {
+ colors: {
+ brand: {
+ primary: '#0A72E4',
+ secondary: '#F5A623',
+ },
+ dark: {
+ 900: '#1a1a1a',
+ 800: '#2b2b2b',
+ },
+ },
+ },
+ },
+ plugins: [],
+};
+export default config;
+```"""
+
+content = content.replace(old, new)
+
+with open("apps/www/content/blog/create-next-js-app.mdx", "w") as f:
+ f.write(content)
+
+print("Fixed!")