import { defineDocs } from "fumadocs-mdx/macro"; import { defineConfig } from "fumapress"; import { fumadocsMdx } from "fumapress/adapters/mdx"; import { metaSchema, pageSchema } from "fumapress/adapters/mdx/schema"; import { createDocsLayoutPage } from "fumapress/layouts/docs"; import { linkValidationPlugin } from "fumapress/plugins/link-validation"; import { sitemapPlugin } from "fumapress/plugins/sitemap"; import { takumiPlugin } from "fumapress/plugins/takumi"; import { version } from "../package.json"; import { ThemeSwitch } from "./src/components/theme-switch"; import { MARKETPLACE, REPO } from "./src/lib/links"; import { MARK_VIEW_BOX, markPath } from "./src/lib/mark"; import { url } from "./src/lib/url"; const docs = defineDocs({ dir: "content", docs: { async: true, lastModified: true, postprocess: { includeProcessedMarkdown: true, }, schema: pageSchema, }, meta: { schema: metaSchema, }, }); const SITE_NAME = "Cursor Action"; const OG = { accent: "#f54e00", background: "#14120b", foreground: "#edecec", muted: "#d5d4d2", }; export default defineConfig({ content: docs.toFumadocsSource(), defaultLayoutProps: { // The sidebar's bottom strip is a bordered box holding whatever icon links // and the theme switch it is given. With one icon link duplicating a nav // link it was a full-width border around a lone button, so both go and the // switch is rendered as the sidebar's own footer below. githubUrl: "", links: [ { text: "GitHub", url: REPO }, { text: "Marketplace", url: MARKETPLACE }, ], nav: { title: SITE_NAME }, themeSwitch: { enabled: false }, }, meta: { root() { return ( <> ); }, }, // Deployed to a CDN as a static site, so no route may depend on a server. mode: "static", renderPage: createDocsLayoutPage({ renderLayout({ next, props }) { return next({ ...props, sidebar: { ...props.sidebar, footer: (
v{version}
), }, }); }, }), site: { baseUrl: url, git: { branch: "main", repo: "cursor-action", rootDir: "docs", user: "PunGrumpy", }, name: SITE_NAME, }, }) .adapters(fumadocsMdx()) .plugins( sitemapPlugin(), linkValidationPlugin(), takumiPlugin({ generate(page) { return { node: (
{this.siteConfig.name?.toUpperCase()}

{page.data.title}

{page.data.description ? (

{page.data.description}

) : null}
), }; }, }), { init() { this.interceptPageMeta(({ page }) => { const title = `${page.data.title} | ${SITE_NAME}`; const canonical = this.siteConfig.baseUrl ? new URL(page.url, this.siteConfig.baseUrl).href : page.url; return ( <> {title} {page.data.description ? ( <> ) : null} ); }); }, name: "site:page-meta", } );