Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pac
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tools
pac
Commits
665f8b6c
Commit
665f8b6c
authored
Oct 13, 2026
by
luoqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(docs): render share previews without remote emoji assets
parent
f190c8a5
Pipeline
#3774
failed in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
apps/pac-docs/app/og/docs/[...slug]/route.tsx
+2
-1
apps/pac-docs/lib/og-text.ts
+4
-0
No files found.
apps/pac-docs/app/og/docs/[...slug]/route.tsx
View file @
665f8b6c
...
@@ -3,6 +3,7 @@ import { notFound } from 'next/navigation';
...
@@ -3,6 +3,7 @@ import { notFound } from 'next/navigation';
import
{
ImageResponse
}
from
'next/og'
;
import
{
ImageResponse
}
from
'next/og'
;
import
{
generate
as
DefaultImage
}
from
'fumadocs-ui/og'
;
import
{
generate
as
DefaultImage
}
from
'fumadocs-ui/og'
;
import
{
appName
}
from
'@/lib/shared'
;
import
{
appName
}
from
'@/lib/shared'
;
import
{
ogText
}
from
'@/lib/og-text'
;
import
{
readFileSync
}
from
'node:fs'
;
import
{
readFileSync
}
from
'node:fs'
;
import
{
join
}
from
'node:path'
;
import
{
join
}
from
'node:path'
;
...
@@ -18,7 +19,7 @@ export async function GET(_req: Request, { params }: RouteContext<'/og/docs/[...
...
@@ -18,7 +19,7 @@ export async function GET(_req: Request, { params }: RouteContext<'/og/docs/[...
return
new
ImageResponse
(
return
new
ImageResponse
(
<
div
style=
{
{
display
:
'flex'
,
width
:
'100%'
,
height
:
'100%'
,
fontFamily
:
'PAC Docs Sans'
}
}
>
<
div
style=
{
{
display
:
'flex'
,
width
:
'100%'
,
height
:
'100%'
,
fontFamily
:
'PAC Docs Sans'
}
}
>
<
DefaultImage
title=
{
page
.
data
.
title
}
description=
{
page
.
data
.
description
}
site=
{
appName
}
/>
<
DefaultImage
title=
{
ogText
(
page
.
data
.
title
)
}
description=
{
ogText
(
page
.
data
.
description
)
}
site=
{
ogText
(
appName
)
}
/>
</
div
>,
</
div
>,
{
{
width
:
1200
,
width
:
1200
,
...
...
apps/pac-docs/lib/og-text.ts
0 → 100644
View file @
665f8b6c
/** 分享预览用纯文本;Next/OG 会为 emoji 下载远程素材,正文保持原样。 */
export
function
ogText
(
text
:
string
|
undefined
):
string
{
return
(
text
??
''
).
replace
(
/
[\p
{Extended_Pictographic}
\p
{Emoji_Presentation}
\u
200D
\u
FE0E
\u
FE0F
\u
20E3
]
/g
u
,
''
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment