mirror of
https://github.com/dathere/ckanaction.git
synced 2025-12-27 13:26:59 +00:00
build: update dependencies and fumadocs
This commit is contained in:
parent
100165ec29
commit
fd5ebf4af0
144 changed files with 301 additions and 431 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { source } from '@/lib/source';
|
||||
import { createFromSource } from 'fumadocs-core/search/server';
|
||||
import { createFromSource } from "fumadocs-core/search/server";
|
||||
import { source } from "@/lib/source";
|
||||
|
||||
export const { GET } = createFromSource(source, {
|
||||
// https://docs.orama.com/docs/orama-js/supported-languages
|
||||
language: 'english',
|
||||
language: "english",
|
||||
});
|
||||
|
|
|
|||
|
|
@ -15,11 +15,9 @@ export default async function Page(props: PageProps<"/docs/[[...slug]]">) {
|
|||
const page = source.getPage(params.slug);
|
||||
if (!page) notFound();
|
||||
|
||||
// @ts-expect-error
|
||||
const MDX = page.data.body;
|
||||
|
||||
return (
|
||||
// @ts-expect-error
|
||||
<DocsPage toc={page.data.toc} full={page.data.full}>
|
||||
<DocsTitle>{page.data.title}</DocsTitle>
|
||||
<DocsDescription>{page.data.description}</DocsDescription>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
import { getLLMText, source } from '@/lib/source';
|
||||
import { getLLMText } from "@/lib/get-llm-text";
|
||||
import { source } from "@/lib/source";
|
||||
|
||||
// cached forever
|
||||
export const revalidate = false;
|
||||
|
||||
export async function GET() {
|
||||
const scan = source.getPages().map(getLLMText);
|
||||
const scanned = await Promise.all(scan);
|
||||
|
||||
return new Response(scanned.join('\n\n'));
|
||||
return new Response(scanned.join("\n\n"));
|
||||
}
|
||||
|
|
|
|||
24
docs/app/llms.mdx/[[...slug]]/route.ts
Normal file
24
docs/app/llms.mdx/[[...slug]]/route.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { notFound } from "next/navigation";
|
||||
import { getLLMText } from "@/lib/get-llm-text";
|
||||
import { source } from "@/lib/source";
|
||||
|
||||
export const revalidate = false;
|
||||
|
||||
export async function GET(
|
||||
_req: Request,
|
||||
{ params }: RouteContext<"/llms.mdx/[[...slug]]">,
|
||||
) {
|
||||
const { slug } = await params;
|
||||
const page = source.getPage(slug);
|
||||
if (!page) notFound();
|
||||
|
||||
return new Response(await getLLMText(page), {
|
||||
headers: {
|
||||
"Content-Type": "text/markdown",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function generateStaticParams() {
|
||||
return source.generateParams();
|
||||
}
|
||||
|
|
@ -1,26 +1,24 @@
|
|||
import { getPageImage, source } from '@/lib/source';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { ImageResponse } from 'next/og';
|
||||
import { generate as DefaultImage } from 'fumadocs-ui/og';
|
||||
import { generate as DefaultImage } from "fumadocs-ui/og";
|
||||
import { notFound } from "next/navigation";
|
||||
import { ImageResponse } from "next/og";
|
||||
import { getPageImage, source } from "@/lib/source";
|
||||
|
||||
export const revalidate = false;
|
||||
|
||||
export async function GET(
|
||||
_req: Request,
|
||||
{ params }: RouteContext<'/og/docs/[...slug]'>,
|
||||
{ params }: RouteContext<"/og/docs/[...slug]">,
|
||||
) {
|
||||
const { slug } = await params;
|
||||
const page = source.getPage(slug.slice(0, -1));
|
||||
if (!page) notFound();
|
||||
|
||||
return new ImageResponse(
|
||||
(
|
||||
<DefaultImage
|
||||
title={page.data.title}
|
||||
description={page.data.description}
|
||||
site="ckanaction"
|
||||
/>
|
||||
),
|
||||
<DefaultImage
|
||||
title={page.data.title}
|
||||
description={page.data.description}
|
||||
site="ckanaction.dathere.com"
|
||||
/>,
|
||||
{
|
||||
width: 1200,
|
||||
height: 630,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue