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
1 change: 1 addition & 0 deletions content/docs/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"root": true,
"pages": [
"getting-started",
"guide",
"deploy",
"configure",
"themes",
Expand Down
2 changes: 1 addition & 1 deletion content/docs/themes/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import { ThemeCard } from '@/components/theme-card';
/>
<ThemeCard
name="Yun"
description="A light & fast & lovely mx web style."
description="A light & fast & lovely mx web style."
author="Innei"
image="/screenshot/Yun.png"
href="/docs/themes/yun"
Expand Down
2 changes: 1 addition & 1 deletion content/docs/themes/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"root": true,
"title": "前端主题",
"description": "部署 Mix Space 的前端主题",
"icons": "Paintbrush",
"icon": "Paintbrush",
"pages": [
"index",
"yohaku",
Expand Down
2 changes: 1 addition & 1 deletion next-sitemap.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const config = {
exclude: ['/api/*', '/og/*', '/llms.txt', '/llms-full.txt', '/llms.mdx/*', '/__next.*'],
};

export default config;
module.exports = config;
4 changes: 2 additions & 2 deletions public/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ Sitemap: https://mx-space.js.org/sitemap.xml

# LLM / AI crawlers
User-agent: *
Allow: /llm.txt
Allow: /llm-full.txt
Allow: /llms.txt
Allow: /llms-full.txt
Allow: /agent-skills/
1 change: 0 additions & 1 deletion src/app/og/docs/[...slug]/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export async function GET(_req: Request, { params }: RouteContext<'/og/docs/[...

export function generateStaticParams() {
return source.getPages().map((page) => ({
lang: page.locale,
slug: getPageImage(page).segments,
}));
}
6 changes: 5 additions & 1 deletion src/components/contributors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ async function fetchContributors(): Promise<{
let page = 1;
while (true) {
try {
const headers: Record<string, string> = { 'User-Agent': 'mx-docs' };
if (process.env.GITHUB_TOKEN) {
headers.Authorization = `Bearer ${process.env.GITHUB_TOKEN}`;
}
const res = await fetch(
`https://api.github.com/repos/${repo}/contributors?per_page=100&page=${page}`,
{
headers: { 'User-Agent': 'mx-docs' },
headers,
next: { revalidate: 86400 },
},
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/landing-hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function LandingHero() {
<svg viewBox="0 0 24 24" fill="currentColor" className="size-5">
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
</svg>
Github
GitHub
</a>
</div>
</div>
Expand Down
13 changes: 8 additions & 5 deletions src/components/type-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChevronDown } from 'lucide-react';
import Link from 'fumadocs-core/link';
import { cva } from 'class-variance-authority';
import { cn } from '../lib/cn';
import { type ComponentProps, type ReactNode, useState } from 'react';
import { type ComponentProps, type ReactNode, useEffect, useState } from 'react';
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './ui/collapsible';

export interface ParameterNode {
Expand Down Expand Up @@ -94,10 +94,13 @@ function Item({
item: TypeNode;
}) {
const id = parentId ? `${parentId}-${name}` : undefined;
const [open, setOpen] = useState(() => {
if (!id || typeof window === 'undefined') return false;
return window.location.hash === `#${id}`;
});
const [open, setOpen] = useState(false);

useEffect(() => {
if (id && window.location.hash === `#${id}`) {
setOpen(true);
}
}, [id]);

return (
<Collapsible
Expand Down
4 changes: 1 addition & 3 deletions src/components/ui/collapsible.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import * as Primitive from '@radix-ui/react-collapsible';
import * as React from 'react';
import { useEffect, useRef, useState } from 'react';
import { useEffect, useState } from 'react';
import { cn } from '../../lib/cn';

export const Collapsible = Primitive.Root;
Expand All @@ -13,10 +13,8 @@ export function CollapsibleContent({
...props
}: React.ComponentPropsWithRef<typeof Primitive.CollapsibleContent>) {
const [animate, setAnimate] = useState(false);
const mounted = useRef(false);

useEffect(() => {
mounted.current = true;
setAnimate(true);
}, []);

Expand Down