Skip to content

Commit aeb214c

Browse files
committed
fix: 国内开发模式下,忽略remarkImage报错
1 parent 9ae3ec6 commit aeb214c

6 files changed

Lines changed: 21 additions & 9 deletions

File tree

app/components/Footer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Github, MessageCircle, ExternalLink } from "lucide-react";
2+
import { BRAND_ICON_TEXT, BRAND_NAME } from "@/lib/brand";
23

34
export function Footer() {
45
return (
@@ -10,11 +11,11 @@ export function Footer() {
1011
<div className="flex items-center space-x-2 mb-4">
1112
<div className="w-8 h-8 bg-gradient-primary rounded-lg flex items-center justify-center">
1213
<span className="text-primary-foreground font-bold text-lg">
13-
IH
14+
{BRAND_ICON_TEXT}
1415
</span>
1516
</div>
1617
<span className="font-bold text-xl bg-gradient-primary bg-clip-text text-transparent">
17-
Involution Hell
18+
{BRAND_NAME}
1819
</span>
1920
</div>
2021
<p className="text-muted-foreground mb-6 max-w-md">
@@ -118,8 +119,7 @@ export function Footer() {
118119
{/* Copyright */}
119120
<div className="border-t border-border mt-12 pt-8 text-center text-muted-foreground">
120121
<p>
121-
&copy; {new Date().getFullYear()} Involution Hell.
122-
完全开源,永远免费。
122+
&copy; {new Date().getFullYear()} {BRAND_NAME}. 完全开源,永远免费。
123123
</p>
124124
</div>
125125
</div>

app/components/Header.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Github as GithubIcon } from "./icons/Github";
55
import { SignInButton } from "./SignInButton";
66
import { auth } from "@/auth";
77
import { UserMenu } from "./UserMenu";
8+
import { BRAND_ICON_TEXT, BRAND_NAME } from "@/lib/brand";
89

910
export async function Header() {
1011
const session = await auth();
@@ -18,13 +19,13 @@ export async function Header() {
1819
<header className="fixed top-0 w-full z-50 bg-background/80 backdrop-blur-lg border-b border-border">
1920
<div className="container mx-auto px-6 h-16 flex items-center justify-between">
2021
<div className="flex items-center gap-3">
21-
{/* 简洁方形标识,无渐变、无圆角 */}
22+
{/* 简洁标识,无渐变、无圆角 */}
2223
<div className="w-8 h-8 border border-gray-300 dark:border-gray-700 flex items-center justify-center text-sm font-semibold">
23-
IH
24+
{BRAND_ICON_TEXT}
2425
</div>
2526
{/* 纯文本标题,无渐变 */}
2627
<span className="font-semibold text-lg tracking-tight">
27-
Involution Hell
28+
{BRAND_NAME}
2829
</span>
2930
</div>
3031

app/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import "./globals.css";
66
import "katex/dist/katex.min.css";
77
import { ThemeProvider } from "@/app/components/ThemeProvider";
88
import { SpeedInsights } from "@vercel/speed-insights/next";
9+
import { BRAND_NAME } from "@/lib/brand";
910

1011
const geistSans = localFont({
1112
src: "./fonts/GeistVF.woff",
@@ -19,7 +20,7 @@ const geistMono = localFont({
1920
});
2021

2122
export const metadata: Metadata = {
22-
title: "Involution Hell",
23+
title: BRAND_NAME,
2324
description: "A modern documentation site built with Fumadocs",
2425
};
2526

lib/brand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const BRAND_NAME = "Involution Hell";
2+
export const BRAND_ICON_TEXT = "🪐";

lib/layout.shared.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
22
import { SignInButton } from "@/app/components/SignInButton";
3+
import { BRAND_NAME } from "@/lib/brand";
34

45
export function baseOptions(): BaseLayoutProps {
56
return {
67
nav: {
7-
title: "Involution Hell",
8+
title: BRAND_NAME,
89
children: (
910
<div className="ms-auto flex justify-end">
1011
<SignInButton />

source.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@ export const docs = defineDocs({
66
dir: "app/docs",
77
});
88

9+
// 默认改为忽略拉取远程图片尺寸时的网络错误,既不中断构建,也能在可访问时自动补全宽高。
10+
const imageOptions =
11+
process.env.DOCS_REMOTE_IMAGE_SIZE === "force"
12+
? undefined
13+
: { onError: "ignore" as const };
14+
915
export default defineConfig({
1016
mdxOptions: {
1117
remarkPlugins: [remarkMath],
1218
rehypePlugins: (v) => [rehypeKatex, ...v],
19+
...(imageOptions && { remarkImageOptions: imageOptions }),
1320
},
1421
});

0 commit comments

Comments
 (0)