create-unmint 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -877,33 +877,12 @@ async function createMdxComponents(targetDir, appDir) {
|
|
|
877
877
|
}
|
|
878
878
|
const componentsPath = appDir.includes("src") ? "@/app/components/docs/mdx" : "@/app/components/docs/mdx";
|
|
879
879
|
const content = `import type { MDXComponents } from 'mdx/types'
|
|
880
|
-
import
|
|
881
|
-
import { Accordion } from '${componentsPath}/accordion'
|
|
882
|
-
import { Callout, Note, Tip, Warning, Info } from '${componentsPath}/callout'
|
|
883
|
-
import { Card, CardGroup } from '${componentsPath}/card'
|
|
884
|
-
import { CodeBlock } from '${componentsPath}/code-block'
|
|
885
|
-
import { Frame } from '${componentsPath}/frame'
|
|
886
|
-
import { Steps, Step } from '${componentsPath}/steps'
|
|
887
|
-
import { Tab, Tabs } from '${componentsPath}/tabs'
|
|
880
|
+
import { getMDXComponents } from '${componentsPath}'
|
|
888
881
|
|
|
889
882
|
export function useMDXComponents(components: MDXComponents): MDXComponents {
|
|
890
883
|
return {
|
|
891
|
-
...
|
|
884
|
+
...getMDXComponents(),
|
|
892
885
|
...components,
|
|
893
|
-
Accordion,
|
|
894
|
-
Callout,
|
|
895
|
-
Note,
|
|
896
|
-
Tip,
|
|
897
|
-
Warning,
|
|
898
|
-
Info,
|
|
899
|
-
Card,
|
|
900
|
-
CardGroup,
|
|
901
|
-
CodeBlock,
|
|
902
|
-
Frame,
|
|
903
|
-
Steps,
|
|
904
|
-
Step,
|
|
905
|
-
Tab,
|
|
906
|
-
Tabs,
|
|
907
886
|
}
|
|
908
887
|
}
|
|
909
888
|
`;
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ import { getMDXComponents } from '../../components/docs/mdx'
|
|
|
6
6
|
import { findNeighbour } from 'fumadocs-core/page-tree'
|
|
7
7
|
import type { Metadata } from 'next'
|
|
8
8
|
import type { Root, Node } from 'fumadocs-core/page-tree'
|
|
9
|
-
import {
|
|
9
|
+
import { getSiteUrl } from '@/lib/theme-config'
|
|
10
10
|
|
|
11
11
|
interface PageProps {
|
|
12
12
|
params: Promise<{ slug?: string[] }>
|
|
@@ -108,7 +108,9 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
|
|
|
108
108
|
const description = page.data.description
|
|
109
109
|
|
|
110
110
|
// Build OG image URL with query params
|
|
111
|
-
|
|
111
|
+
// getSiteUrl() auto-detects Vercel deployments
|
|
112
|
+
const baseUrl = getSiteUrl()
|
|
113
|
+
const ogImageUrl = new URL(`${baseUrl}/api/og`)
|
|
112
114
|
ogImageUrl.searchParams.set('title', title)
|
|
113
115
|
ogImageUrl.searchParams.set('section', section)
|
|
114
116
|
|
|
@@ -119,7 +121,7 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
|
|
|
119
121
|
title,
|
|
120
122
|
description,
|
|
121
123
|
type: 'article',
|
|
122
|
-
url: `${
|
|
124
|
+
url: `${baseUrl}${page.url}`,
|
|
123
125
|
images: [
|
|
124
126
|
{
|
|
125
127
|
url: ogImageUrl.toString(),
|
|
@@ -87,3 +87,18 @@ export function getCSSVariables(mode: 'light' | 'dark') {
|
|
|
87
87
|
'--accent-muted': colors.accentMuted,
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Get the site URL dynamically
|
|
93
|
+
* Priority: NEXT_PUBLIC_SITE_URL > VERCEL_URL > siteConfig.url
|
|
94
|
+
* This allows OG images to work automatically on Vercel without configuration
|
|
95
|
+
*/
|
|
96
|
+
export function getSiteUrl(): string {
|
|
97
|
+
if (process.env.NEXT_PUBLIC_SITE_URL) {
|
|
98
|
+
return process.env.NEXT_PUBLIC_SITE_URL
|
|
99
|
+
}
|
|
100
|
+
if (process.env.VERCEL_URL) {
|
|
101
|
+
return `https://${process.env.VERCEL_URL}`
|
|
102
|
+
}
|
|
103
|
+
return siteConfig.url
|
|
104
|
+
}
|