mirror of
https://github.com/dathere/ckanaction.git
synced 2025-12-18 08:19:26 +00:00
feat(docs): fix build issues, add external links
This commit is contained in:
parent
0fdbdd4d1c
commit
100165ec29
5 changed files with 52 additions and 11 deletions
|
|
@ -1,19 +1,42 @@
|
|||
import Link from 'next/link';
|
||||
import Link from "next/link";
|
||||
|
||||
export default function HomePage() {
|
||||
return (
|
||||
<main className="flex flex-1 flex-col justify-center text-center">
|
||||
<h1 className="mb-4 text-2xl font-bold">ckanaction</h1>
|
||||
<p className="text-fd-muted-foreground">
|
||||
You can open{' '}
|
||||
You can open{" "}
|
||||
<Link
|
||||
href="/docs"
|
||||
className="text-fd-foreground font-semibold underline"
|
||||
>
|
||||
/docs
|
||||
</Link>{' '}
|
||||
</Link>{" "}
|
||||
and see the interactive documentation.
|
||||
</p>
|
||||
<footer className="absolute bottom-2 ml-4 flex flex-col bg-brand-secondary text-brand-secondary-foreground rounded-2xl">
|
||||
<p className="text-xs">
|
||||
Provided by{" "}
|
||||
<a
|
||||
href="https://dathere.com"
|
||||
target="_blank"
|
||||
className="font-medium text-blue-400"
|
||||
rel="noopener"
|
||||
>
|
||||
datHere
|
||||
</a>
|
||||
.{" "}
|
||||
<a
|
||||
href="https://dathere.com/privacy-policy/"
|
||||
target="_blank"
|
||||
className="font-medium text-blue-400"
|
||||
rel="noopener"
|
||||
>
|
||||
Privacy Policy
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
</footer>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,25 @@
|
|||
import { getPageImage, source } from '@/lib/source';
|
||||
import { createRelativeLink } from "fumadocs-ui/mdx";
|
||||
import {
|
||||
DocsBody,
|
||||
DocsDescription,
|
||||
DocsPage,
|
||||
DocsTitle,
|
||||
} from 'fumadocs-ui/page';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { getMDXComponents } from '@/mdx-components';
|
||||
import type { Metadata } from 'next';
|
||||
import { createRelativeLink } from 'fumadocs-ui/mdx';
|
||||
} from "fumadocs-ui/page";
|
||||
import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import { getPageImage, source } from "@/lib/source";
|
||||
import { getMDXComponents } from "@/mdx-components";
|
||||
|
||||
export default async function Page(props: PageProps<'/docs/[[...slug]]'>) {
|
||||
export default async function Page(props: PageProps<"/docs/[[...slug]]">) {
|
||||
const params = await props.params;
|
||||
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>
|
||||
|
|
@ -38,7 +40,7 @@ export async function generateStaticParams() {
|
|||
}
|
||||
|
||||
export async function generateMetadata(
|
||||
props: PageProps<'/docs/[[...slug]]'>,
|
||||
props: PageProps<"/docs/[[...slug]]">,
|
||||
): Promise<Metadata> {
|
||||
const params = await props.params;
|
||||
const page = source.getPage(params.slug);
|
||||
|
|
|
|||
|
|
@ -37,4 +37,6 @@ The source code of ckanaction can be found at [github.com/dathere/ckanaction](ht
|
|||
|
||||
You may also explore this web app to view more code examples for each endpoint and also use an interactive GUI for sending HTTP requests to any local or remote CKAN instance.
|
||||
|
||||
View the GIF below to see how to point to a specific CKAN API endpoint using the interactive GUI, which by default points to a local CKAN instance endpoint's URL.
|
||||
|
||||

|
||||
|
|
|
|||
12
docs/content/docs/meta.json
Normal file
12
docs/content/docs/meta.json
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"pages": [
|
||||
"--- ---",
|
||||
"index",
|
||||
"---🎁 Interactive CKAN API GUI---",
|
||||
"...",
|
||||
"--- ---",
|
||||
"[Source Code](https://github.com/dathere/ckanaction)",
|
||||
"[Support and Feedback](https://support.dathere.com)",
|
||||
"[Privacy Policy](https://dathere.com/privacy-policy/)"
|
||||
]
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import { docs } from "@/.source";
|
|||
export const source = loader({
|
||||
baseUrl: "/docs",
|
||||
source: docs.toFumadocsSource(),
|
||||
// @ts-expect-error
|
||||
plugins: [lucideIconsPlugin(), openapiPlugin()],
|
||||
});
|
||||
|
||||
|
|
@ -20,6 +21,7 @@ export function getPageImage(page: InferPageType<typeof source>) {
|
|||
}
|
||||
|
||||
export async function getLLMText(page: InferPageType<typeof source>) {
|
||||
// @ts-expect-error
|
||||
const processed = await page.data.getText("processed");
|
||||
|
||||
return `# ${page.data.title} (${page.url})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue