Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

<p align="center">
<a href="https://involutionhell.com">
<a href="https://involutionhell.com/?utm_source=github&utm_medium=readme&utm_campaign=logo">
<picture>
<!-- Dark mode logo -->
<source media="(prefers-color-scheme: dark)" srcset="./public/logo/logoInDark.svg">
Expand All @@ -21,7 +21,7 @@
<img alt="Next.js" src="https://img.shields.io/badge/Next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white" />
<img alt="Vercel" src="https://img.shields.io/badge/Vercel-000000?style=for-the-badge&logo=vercel&logoColor=white" />
<a href="https://github.com/InvolutionHell/involutionhell/blob/main/LICENSE">
<a href="https://involutionhell.com">
<a href="https://involutionhell.com/?utm_source=github&utm_medium=readme&utm_campaign=badge">
<img src="https://img.shields.io/badge/Website-involutionhell.com-blue?style=for-the-badge" alt="Official Website">
</a>
</p>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

<p align="center">
<a href="https://involutionhell.com">
<a href="https://involutionhell.com/?utm_source=github&utm_medium=readme&utm_campaign=logo">
<picture>
<!-- Dark mode logo -->
<source media="(prefers-color-scheme: dark)" srcset="./public/logo/logoInDark.svg">
Expand All @@ -21,7 +21,7 @@
<img alt="Next.js" src="https://img.shields.io/badge/Next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white" />
<img alt="Vercel" src="https://img.shields.io/badge/Vercel-000000?style=for-the-badge&logo=vercel&logoColor=white" />
<a href="https://github.com/InvolutionHell/involutionhell/blob/main/LICENSE">
<a href="https://involutionhell.com">
<a href="https://involutionhell.com/?utm_source=github&utm_medium=readme&utm_campaign=badge">
<img src="https://img.shields.io/badge/Website-involutionhell.com-blue?style=for-the-badge" alt="Official Website">
</a>
</p>
Expand Down
7 changes: 6 additions & 1 deletion app/components/DocShareButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ export function DocShareButton() {
}, []);

const handleCopy = async () => {
const url = window.location.href;
// 用户点"复制链接"必然是要发到外面(DC/微信/X)
// 给链接打上 UTM,回流时能在 GA Source 维度看到 doc_share,区别于 (direct)
const target = new URL(window.location.href);
target.searchParams.set("utm_source", "doc_share");
target.searchParams.set("utm_medium", "user_share");
const url = target.toString();
try {
await navigator.clipboard.writeText(url);
setCopied(true);
Expand Down
16 changes: 16 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
// next.config.mjs
import path from "node:path";
import { fileURLToPath } from "node:url";
import { createMDX } from "fumadocs-mdx/next";
import createNextIntlPlugin from "next-intl/plugin";
import { withSentryConfig } from "@sentry/nextjs";

// Next.js 16 detects multi-lockfile environments by searching upward for
// pnpm-lock.yaml / package-lock.json / yarn.lock. 当父目录意外有 lockfile
// 时(如开发服务器上 /home/ubuntu/package-lock.json),Next 会把 workspace
// root 推到上层,turbopack 跟着到错的目录解析 node_modules,
// 触发 "Can't resolve 'tailwindcss'" 之类报错。
// 显式锁定到 frontend 自己目录,turbopack + outputFileTracing 双保险。
const projectRoot = path.dirname(fileURLToPath(import.meta.url));

/**
* IMPORTANT: remarkImage 配置已移至 source.config.ts 统一管理
*
Expand All @@ -22,6 +32,12 @@ const withNextIntl = createNextIntlPlugin("./i18n/request.ts");
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
// 强制锁定 turbopack 和 SSR file tracing 的根目录到 frontend/ 自己,
// 避免上层意外 lockfile 把 root 推错(详见文件顶部注释)。
turbopack: {
root: projectRoot,
},
outputFileTracingRoot: projectRoot,
/**
* docs 目录整理产生的 URL 变化 → 301 重定向。
*
Expand Down
Loading