@vercel/geistdocs 1.2.3 → 1.3.0-canary.5af98bc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +3 -0
- package/dist/components/callout.d.ts +12 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +7 -0
- package/dist/components/code-block-tabs.d.ts +7 -0
- package/dist/components/code-block-tabs.d.ts.map +1 -0
- package/dist/components/code-block-tabs.js +7 -0
- package/dist/components/code-block.d.ts +14 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +45 -0
- package/dist/components/copy-prompt.d.ts +11 -0
- package/dist/components/copy-prompt.d.ts.map +1 -0
- package/dist/components/copy-prompt.js +58 -0
- package/dist/components/mermaid.d.ts +4 -0
- package/dist/components/mermaid.d.ts.map +1 -0
- package/dist/components/mermaid.js +44 -0
- package/dist/components/theme-aware-image.d.ts +12 -0
- package/dist/components/theme-aware-image.d.ts.map +1 -0
- package/dist/components/theme-aware-image.js +8 -0
- package/dist/components/video.d.ts +6 -0
- package/dist/components/video.d.ts.map +1 -0
- package/dist/components/video.js +3 -0
- package/dist/config.d.ts +52 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/controls.d.ts +15 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/controls.js +52 -0
- package/dist/internal/chat/context.d.ts +19 -0
- package/dist/internal/chat/context.d.ts.map +1 -0
- package/dist/internal/chat/context.js +36 -0
- package/dist/internal/chat/conversation.d.ts +10 -0
- package/dist/internal/chat/conversation.d.ts.map +1 -0
- package/dist/internal/chat/conversation.js +16 -0
- package/dist/internal/chat/copy-chat.d.ts +5 -0
- package/dist/internal/chat/copy-chat.d.ts.map +1 -0
- package/dist/internal/chat/copy-chat.js +35 -0
- package/dist/internal/chat/db.d.ts +13 -0
- package/dist/internal/chat/db.d.ts.map +1 -0
- package/dist/internal/chat/db.js +19 -0
- package/dist/internal/chat/message-metadata.d.ts +8 -0
- package/dist/internal/chat/message-metadata.d.ts.map +1 -0
- package/dist/internal/chat/message-metadata.js +29 -0
- package/dist/internal/chat/message.d.ts +11 -0
- package/dist/internal/chat/message.d.ts.map +1 -0
- package/dist/internal/chat/message.js +11 -0
- package/dist/internal/chat/prompt-input.d.ts +13 -0
- package/dist/internal/chat/prompt-input.d.ts.map +1 -0
- package/dist/internal/chat/prompt-input.js +39 -0
- package/dist/internal/chat/shell.d.ts +2 -0
- package/dist/internal/chat/shell.d.ts.map +1 -0
- package/dist/internal/chat/shell.js +194 -0
- package/dist/internal/chat/shimmer.d.ts +11 -0
- package/dist/internal/chat/shimmer.d.ts.map +1 -0
- package/dist/internal/chat/shimmer.js +18 -0
- package/dist/internal/chat/sources.d.ts +13 -0
- package/dist/internal/chat/sources.d.ts.map +1 -0
- package/dist/internal/chat/sources.js +9 -0
- package/dist/internal/chat/suggestion.d.ts +11 -0
- package/dist/internal/chat/suggestion.d.ts.map +1 -0
- package/dist/internal/chat/suggestion.js +12 -0
- package/dist/internal/cn.d.ts +3 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/internal/cn.js +3 -0
- package/dist/internal/feedback-action.d.ts +14 -0
- package/dist/internal/feedback-action.d.ts.map +1 -0
- package/dist/internal/feedback-action.js +34 -0
- package/dist/internal/i18n.d.ts +6 -0
- package/dist/internal/i18n.d.ts.map +1 -0
- package/dist/internal/i18n.js +18 -0
- package/dist/internal/languages.d.ts +7 -0
- package/dist/internal/languages.d.ts.map +1 -0
- package/dist/internal/languages.js +18 -0
- package/dist/internal/not-implemented.d.ts +2 -0
- package/dist/internal/not-implemented.d.ts.map +1 -0
- package/dist/internal/not-implemented.js +4 -0
- package/dist/internal/page-actions-client.d.ts +13 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -0
- package/dist/internal/page-actions-client.js +160 -0
- package/dist/internal/page-actions.d.ts +18 -0
- package/dist/internal/page-actions.d.ts.map +1 -0
- package/dist/internal/page-actions.js +4 -0
- package/dist/internal/provider-client.d.ts +9 -0
- package/dist/internal/provider-client.d.ts.map +1 -0
- package/dist/internal/provider-client.js +23 -0
- package/dist/internal/search.d.ts +5 -0
- package/dist/internal/search.d.ts.map +1 -0
- package/dist/internal/search.js +14 -0
- package/dist/internal/sidebar.d.ts +6 -0
- package/dist/internal/sidebar.d.ts.map +1 -0
- package/dist/internal/sidebar.js +38 -0
- package/dist/internal/table-of-contents.d.ts +9 -0
- package/dist/internal/table-of-contents.d.ts.map +1 -0
- package/dist/internal/table-of-contents.js +5 -0
- package/dist/internal/ui/button-group.d.ts +13 -0
- package/dist/internal/ui/button-group.d.ts.map +1 -0
- package/dist/internal/ui/button-group.js +26 -0
- package/dist/internal/ui/button.d.ts +12 -0
- package/dist/internal/ui/button.d.ts.map +1 -0
- package/dist/internal/ui/button.js +33 -0
- package/dist/internal/ui/card.d.ts +6 -0
- package/dist/internal/ui/card.d.ts.map +1 -0
- package/dist/internal/ui/card.js +14 -0
- package/dist/internal/ui/collapsible.d.ts +6 -0
- package/dist/internal/ui/collapsible.d.ts.map +1 -0
- package/dist/internal/ui/collapsible.js +12 -0
- package/dist/internal/ui/drawer.d.ts +6 -0
- package/dist/internal/ui/drawer.d.ts.map +1 -0
- package/dist/internal/ui/drawer.js +13 -0
- package/dist/internal/ui/dropdown-menu.d.ts +22 -0
- package/dist/internal/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/internal/ui/dropdown-menu.js +41 -0
- package/dist/internal/ui/input-group.d.ts +15 -0
- package/dist/internal/ui/input-group.d.ts.map +1 -0
- package/dist/internal/ui/input-group.js +44 -0
- package/dist/internal/ui/input.d.ts +3 -0
- package/dist/internal/ui/input.d.ts.map +1 -0
- package/dist/internal/ui/input.js +5 -0
- package/dist/internal/ui/kbd.d.ts +4 -0
- package/dist/internal/ui/kbd.d.ts.map +1 -0
- package/dist/internal/ui/kbd.js +8 -0
- package/dist/internal/ui/popover.d.ts +6 -0
- package/dist/internal/ui/popover.d.ts.map +1 -0
- package/dist/internal/ui/popover.js +13 -0
- package/dist/internal/ui/scroll-area.d.ts +5 -0
- package/dist/internal/ui/scroll-area.d.ts.map +1 -0
- package/dist/internal/ui/scroll-area.js +12 -0
- package/dist/internal/ui/separator.d.ts +4 -0
- package/dist/internal/ui/separator.d.ts.map +1 -0
- package/dist/internal/ui/separator.js +7 -0
- package/dist/internal/ui/sheet.d.ts +10 -0
- package/dist/internal/ui/sheet.d.ts.map +1 -0
- package/dist/internal/ui/sheet.js +24 -0
- package/dist/internal/ui/sonner.d.ts +3 -0
- package/dist/internal/ui/sonner.d.ts.map +1 -0
- package/dist/internal/ui/sonner.js +20 -0
- package/dist/internal/ui/spinner.d.ts +3 -0
- package/dist/internal/ui/spinner.d.ts.map +1 -0
- package/dist/internal/ui/spinner.js +6 -0
- package/dist/internal/ui/textarea.d.ts +3 -0
- package/dist/internal/ui/textarea.d.ts.map +1 -0
- package/dist/internal/ui/textarea.js +5 -0
- package/dist/internal/ui/tooltip.d.ts +7 -0
- package/dist/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/internal/ui/tooltip.js +16 -0
- package/dist/internal/use-mobile.d.ts +2 -0
- package/dist/internal/use-mobile.d.ts.map +1 -0
- package/dist/internal/use-mobile.js +16 -0
- package/dist/layout.d.ts +13 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +31 -0
- package/dist/mdx.d.ts +36 -0
- package/dist/mdx.d.ts.map +1 -0
- package/dist/mdx.js +74 -0
- package/dist/pages/docs.d.ts +55 -0
- package/dist/pages/docs.d.ts.map +1 -0
- package/dist/pages/docs.js +69 -0
- package/dist/proxy.d.ts +21 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +109 -0
- package/dist/routes/chat.d.ts +13 -0
- package/dist/routes/chat.d.ts.map +1 -0
- package/dist/routes/chat.js +229 -0
- package/dist/routes/llms.d.ts +33 -0
- package/dist/routes/llms.d.ts.map +1 -0
- package/dist/routes/llms.js +39 -0
- package/dist/routes/search.d.ts +10 -0
- package/dist/routes/search.d.ts.map +1 -0
- package/dist/routes/search.js +33 -0
- package/dist/routes/sitemap.d.ts +35 -0
- package/dist/routes/sitemap.d.ts.map +1 -0
- package/dist/routes/sitemap.js +150 -0
- package/dist/sidebar.d.ts +11 -0
- package/dist/sidebar.d.ts.map +1 -0
- package/dist/sidebar.js +16 -0
- package/dist/source.d.ts +30 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +72 -0
- package/package.json +137 -9
- package/styles.css +193 -0
- package/template/_gitignore +29 -0
- package/template/app/[lang]/(home)/components/centered-section.tsx +26 -0
- package/template/app/[lang]/(home)/components/cta.tsx +19 -0
- package/template/app/[lang]/(home)/components/hero.tsx +27 -0
- package/template/app/[lang]/(home)/components/one-two-section.tsx +25 -0
- package/template/app/[lang]/(home)/components/templates.tsx +50 -0
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +20 -0
- package/template/app/[lang]/(home)/layout.tsx +14 -0
- package/template/app/[lang]/(home)/page.tsx +126 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +19 -0
- package/template/app/[lang]/docs/layout.tsx +14 -0
- package/template/app/[lang]/layout.tsx +29 -0
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +7 -0
- package/template/app/[lang]/llms.txt/route.ts +6 -0
- package/template/app/[lang]/og/[...slug]/background.png +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-regular.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-semibold.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/route.tsx +95 -0
- package/template/app/[lang]/rss.xml/route.ts +52 -0
- package/template/app/[lang]/sitemap.md/route.ts +9 -0
- package/template/app/actions/feedback/emotions.ts +18 -0
- package/template/app/actions/feedback/index.ts +45 -0
- package/template/app/api/chat/route.ts +8 -0
- package/template/app/api/search/route.ts +5 -0
- package/template/app/favicon.ico +0 -0
- package/template/app/global.css +2 -0
- package/template/app/robots.ts +14 -0
- package/template/app/sitemap.ts +36 -0
- package/template/app/styles/geistdocs.css +554 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right-small.tsx +35 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-check.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-down-small.tsx +30 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-right.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-copy.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-file-text.tsx +25 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-menu-alt.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-slash-forward.tsx +36 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/index.tsx +11 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/index.tsx +14 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-elements.tsx +29 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-sdk.tsx +38 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-chat-sdk.tsx +42 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-flags-sdk.tsx +42 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-icon-vercel.tsx +31 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-streamdown.tsx +29 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-vercel-oss.tsx +24 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-workflow-sdk.tsx +73 -0
- package/template/components/geistdocs/callout.tsx +40 -0
- package/template/components/geistdocs/chat.tsx +24 -0
- package/template/components/geistdocs/code-block-tabs.tsx +61 -0
- package/template/components/geistdocs/code-block.tsx +134 -0
- package/template/components/geistdocs/copy-page.tsx +27 -0
- package/template/components/geistdocs/desktop-menu.tsx +52 -0
- package/template/components/geistdocs/docs-layout.tsx +20 -0
- package/template/components/geistdocs/docs-page.tsx +35 -0
- package/template/components/geistdocs/edit-source.tsx +30 -0
- package/template/components/geistdocs/feedback.tsx +139 -0
- package/template/components/geistdocs/footer.tsx +30 -0
- package/template/components/geistdocs/github-button.tsx +19 -0
- package/template/components/geistdocs/home-layout.tsx +46 -0
- package/template/components/geistdocs/icons.tsx +13 -0
- package/template/components/geistdocs/installer.tsx +58 -0
- package/template/components/geistdocs/language-selector.tsx +3 -0
- package/template/components/geistdocs/mdx-components.tsx +5 -0
- package/template/components/geistdocs/mermaid.tsx +68 -0
- package/template/components/geistdocs/mobile-docs-bar.tsx +77 -0
- package/template/components/geistdocs/mobile-menu.tsx +150 -0
- package/template/components/geistdocs/navbar-logo.tsx +124 -0
- package/template/components/geistdocs/navbar.tsx +22 -0
- package/template/components/geistdocs/provider.tsx +31 -0
- package/template/components/geistdocs/rss-button.tsx +10 -0
- package/template/components/geistdocs/scroll-top.tsx +21 -0
- package/template/components/geistdocs/search.tsx +17 -0
- package/template/components/geistdocs/sidebar.tsx +128 -0
- package/template/components/geistdocs/theme-aware-image.tsx +22 -0
- package/template/components/geistdocs/theme-toggle.tsx +3 -0
- package/template/components/geistdocs/video.tsx +16 -0
- package/template/components/ui/badge.tsx +46 -0
- package/template/components/ui/button-group.tsx +83 -0
- package/template/components/ui/button.tsx +60 -0
- package/template/components/ui/card.tsx +92 -0
- package/template/components/ui/collapsible.tsx +33 -0
- package/template/components/ui/command-prompt.tsx +488 -0
- package/template/components/ui/command.tsx +184 -0
- package/template/components/ui/dialog.tsx +143 -0
- package/template/components/ui/drawer.tsx +135 -0
- package/template/components/ui/dropdown-menu.tsx +257 -0
- package/template/components/ui/hover-card.tsx +44 -0
- package/template/components/ui/input-group.tsx +170 -0
- package/template/components/ui/input.tsx +21 -0
- package/template/components/ui/kbd.tsx +28 -0
- package/template/components/ui/navigation-menu.tsx +192 -0
- package/template/components/ui/popover.tsx +48 -0
- package/template/components/ui/scroll-area.tsx +58 -0
- package/template/components/ui/select.tsx +187 -0
- package/template/components/ui/separator.tsx +28 -0
- package/template/components/ui/sheet.tsx +139 -0
- package/template/components/ui/sonner.tsx +40 -0
- package/template/components/ui/spinner.tsx +16 -0
- package/template/components/ui/textarea.tsx +18 -0
- package/template/components/ui/tooltip.tsx +61 -0
- package/template/components.json +22 -0
- package/template/content/docs/ask-ai.cn.mdx +85 -0
- package/template/content/docs/ask-ai.mdx +89 -0
- package/template/content/docs/configuration.cn.mdx +115 -0
- package/template/content/docs/configuration.mdx +118 -0
- package/template/content/docs/deployment.cn.mdx +34 -0
- package/template/content/docs/deployment.mdx +40 -0
- package/template/content/docs/edit-on-github.cn.mdx +47 -0
- package/template/content/docs/edit-on-github.mdx +51 -0
- package/template/content/docs/env.cn.mdx +25 -0
- package/template/content/docs/env.mdx +29 -0
- package/template/content/docs/feedback.cn.mdx +85 -0
- package/template/content/docs/feedback.mdx +89 -0
- package/template/content/docs/getting-started.cn.mdx +86 -0
- package/template/content/docs/getting-started.mdx +107 -0
- package/template/content/docs/index.cn.mdx +54 -0
- package/template/content/docs/index.mdx +85 -0
- package/template/content/docs/internationalization.cn.mdx +111 -0
- package/template/content/docs/internationalization.mdx +122 -0
- package/template/content/docs/llms-txt.cn.mdx +50 -0
- package/template/content/docs/llms-txt.mdx +54 -0
- package/template/content/docs/md.cn.mdx +68 -0
- package/template/content/docs/md.mdx +72 -0
- package/template/content/docs/meta.json +21 -0
- package/template/content/docs/open-in-chat.cn.mdx +78 -0
- package/template/content/docs/open-in-chat.mdx +82 -0
- package/template/content/docs/provider.cn.mdx +69 -0
- package/template/content/docs/provider.mdx +73 -0
- package/template/content/docs/rss.cn.mdx +104 -0
- package/template/content/docs/rss.mdx +108 -0
- package/template/content/docs/syntax.cn.mdx +416 -0
- package/template/content/docs/syntax.mdx +411 -0
- package/template/content/docs/theme-aware-image.mdx +57 -0
- package/template/geistdocs.tsx +51 -0
- package/template/hooks/geistdocs/use-sidebar.ts +13 -0
- package/template/hooks/use-mobile.ts +19 -0
- package/template/lib/geistdocs/config.tsx +27 -0
- package/template/lib/geistdocs/fonts.ts +18 -0
- package/template/lib/geistdocs/i18n.ts +13 -0
- package/template/lib/geistdocs/md-tracking.ts +56 -0
- package/template/lib/geistdocs/source.ts +12 -0
- package/template/lib/utils.ts +6 -0
- package/template/next.config.ts +22 -0
- package/template/package.json +63 -0
- package/template/postcss.config.mjs +5 -0
- package/template/proxy.ts +16 -0
- package/template/source.config.ts +62 -0
- package/template/tsconfig.json +37 -0
- package/dist/index.js +0 -2
- /package/dist/{index.d.ts → cli/index.d.ts} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
|
|
4
|
+
# generated content
|
|
5
|
+
.source
|
|
6
|
+
|
|
7
|
+
# test and build output
|
|
8
|
+
coverage
|
|
9
|
+
.next
|
|
10
|
+
out
|
|
11
|
+
build
|
|
12
|
+
dist
|
|
13
|
+
*.tsbuildinfo
|
|
14
|
+
|
|
15
|
+
# local environment
|
|
16
|
+
.env*.local
|
|
17
|
+
.vercel
|
|
18
|
+
|
|
19
|
+
# logs
|
|
20
|
+
npm-debug.log*
|
|
21
|
+
yarn-debug.log*
|
|
22
|
+
yarn-error.log*
|
|
23
|
+
pnpm-debug.log*
|
|
24
|
+
|
|
25
|
+
# system files
|
|
26
|
+
.DS_Store
|
|
27
|
+
|
|
28
|
+
# Turborepo
|
|
29
|
+
.turbo
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
interface CenteredSectionProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
description: string;
|
|
6
|
+
title: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const CenteredSection = ({
|
|
10
|
+
title,
|
|
11
|
+
description,
|
|
12
|
+
children,
|
|
13
|
+
}: CenteredSectionProps) => (
|
|
14
|
+
<div className="grid items-center gap-10 overflow-hidden px-4 py-8 sm:px-12 sm:py-12">
|
|
15
|
+
<div className="mx-auto grid max-w-lg gap-4 text-center">
|
|
16
|
+
<h2 className="font-semibold text-xl tracking-tight sm:text-2xl md:text-3xl lg:text-[40px]">
|
|
17
|
+
{title}
|
|
18
|
+
</h2>
|
|
19
|
+
<p className="text-balance text-lg text-muted-foreground">
|
|
20
|
+
{description}
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
{children}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import DynamicLink from "fumadocs-core/dynamic-link";
|
|
2
|
+
import { Button } from "@/components/ui/button";
|
|
3
|
+
|
|
4
|
+
interface CTAProps {
|
|
5
|
+
cta: string;
|
|
6
|
+
href: string;
|
|
7
|
+
title: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const CTA = ({ title, href, cta }: CTAProps) => (
|
|
11
|
+
<section className="flex flex-col gap-4 px-8 py-10 sm:px-12 md:flex-row md:items-center md:justify-between">
|
|
12
|
+
<h2 className="font-semibold text-xl tracking-tight sm:text-2xl md:text-3xl lg:text-[40px]">
|
|
13
|
+
{title}
|
|
14
|
+
</h2>
|
|
15
|
+
<Button asChild size="lg">
|
|
16
|
+
<DynamicLink href={`/[lang]${href}`}>{cta}</DynamicLink>
|
|
17
|
+
</Button>
|
|
18
|
+
</section>
|
|
19
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Badge } from "@/components/ui/badge";
|
|
3
|
+
|
|
4
|
+
interface HeroProps {
|
|
5
|
+
badge: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
description: string;
|
|
8
|
+
title: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Hero = ({ badge, title, description, children }: HeroProps) => (
|
|
12
|
+
<section className="mt-(--fd-nav-height) space-y-6 px-4 pt-16 pb-16 text-center sm:pt-24">
|
|
13
|
+
<div className="mx-auto w-full max-w-4xl space-y-5">
|
|
14
|
+
<Badge className="rounded-full" variant="secondary">
|
|
15
|
+
<div className="size-2 rounded-full bg-muted-foreground" />
|
|
16
|
+
<p>{badge}</p>
|
|
17
|
+
</Badge>
|
|
18
|
+
<h1 className="text-balance text-center font-semibold text-[40px]! leading-[1.1] tracking-tight sm:text-5xl! lg:font-semibold xl:text-6xl!">
|
|
19
|
+
{title}
|
|
20
|
+
</h1>
|
|
21
|
+
<p className="mx-auto max-w-3xl text-balance text-muted-foreground leading-relaxed sm:text-xl">
|
|
22
|
+
{description}
|
|
23
|
+
</p>
|
|
24
|
+
</div>
|
|
25
|
+
{children}
|
|
26
|
+
</section>
|
|
27
|
+
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
interface OneTwoSectionProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
description: string;
|
|
6
|
+
title: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const OneTwoSection = ({
|
|
10
|
+
title,
|
|
11
|
+
description,
|
|
12
|
+
children,
|
|
13
|
+
}: OneTwoSectionProps) => (
|
|
14
|
+
<div className="grid gap-12 p-8 sm:grid-cols-3 sm:gap-0 sm:divide-x sm:p-0">
|
|
15
|
+
<div className="flex flex-col gap-2 text-balance sm:p-12">
|
|
16
|
+
<h2 className="font-semibold text-xl tracking-tight sm:text-2xl md:text-3xl">
|
|
17
|
+
{title}
|
|
18
|
+
</h2>
|
|
19
|
+
<p className="mt-2 text-balance text-lg text-muted-foreground">
|
|
20
|
+
{description}
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
<div className="sm:col-span-2 sm:p-12">{children}</div>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import Image from "next/image";
|
|
2
|
+
import { cn } from "@/lib/utils";
|
|
3
|
+
|
|
4
|
+
interface TemplatesProps {
|
|
5
|
+
data: {
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
link: string;
|
|
9
|
+
image: string;
|
|
10
|
+
}[];
|
|
11
|
+
description: string;
|
|
12
|
+
title: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const Templates = ({ title, description, data }: TemplatesProps) => (
|
|
16
|
+
<div className="grid gap-12 p-8 px-4 py-8 sm:p-12 sm:px-12 sm:py-12">
|
|
17
|
+
<div className="grid max-w-3xl gap-2 text-balance">
|
|
18
|
+
<h2 className="font-semibold text-xl tracking-tight sm:text-2xl md:text-3xl lg:text-[40px]">
|
|
19
|
+
{title}
|
|
20
|
+
</h2>
|
|
21
|
+
<p className="text-balance text-lg text-muted-foreground">
|
|
22
|
+
{description}
|
|
23
|
+
</p>
|
|
24
|
+
</div>
|
|
25
|
+
<div className="grid gap-8 md:grid-cols-3">
|
|
26
|
+
{data.map((item) => (
|
|
27
|
+
<a
|
|
28
|
+
className="group flex-col overflow-hidden rounded-lg border bg-background p-4"
|
|
29
|
+
href={item.link}
|
|
30
|
+
key={item.title}
|
|
31
|
+
>
|
|
32
|
+
<h3 className="font-medium tracking-tight">{item.title}</h3>
|
|
33
|
+
<p className="line-clamp-2 text-muted-foreground text-sm">
|
|
34
|
+
{item.description}
|
|
35
|
+
</p>
|
|
36
|
+
<Image
|
|
37
|
+
alt={item.title}
|
|
38
|
+
className={cn(
|
|
39
|
+
"mt-8 -mb-12 ml-7 aspect-video -rotate-3 overflow-hidden rounded-md border object-cover object-top",
|
|
40
|
+
"transition-transform duration-300 group-hover:-rotate-1 group-hover:scale-105"
|
|
41
|
+
)}
|
|
42
|
+
height={336}
|
|
43
|
+
src={item.image}
|
|
44
|
+
width={640}
|
|
45
|
+
/>
|
|
46
|
+
</a>
|
|
47
|
+
))}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface TextGridSectionProps {
|
|
2
|
+
data: {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const TextGridSection = ({ data }: TextGridSectionProps) => (
|
|
10
|
+
<div className="grid gap-8 px-4 py-8 sm:px-12 sm:py-12 md:grid-cols-3">
|
|
11
|
+
{data.map((item) => (
|
|
12
|
+
<div key={item.id}>
|
|
13
|
+
<h3 className="mb-2 font-semibold text-lg tracking-tight">
|
|
14
|
+
{item.title}
|
|
15
|
+
</h3>
|
|
16
|
+
<p className="text-muted-foreground">{item.description}</p>
|
|
17
|
+
</div>
|
|
18
|
+
))}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HomeLayout } from "@/components/geistdocs/home-layout";
|
|
2
|
+
import { source } from "@/lib/geistdocs/source";
|
|
3
|
+
|
|
4
|
+
const Layout = async ({ children, params }: LayoutProps<"/[lang]">) => {
|
|
5
|
+
const { lang } = await params;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<HomeLayout tree={source.pageTree[lang]}>
|
|
9
|
+
<div className="pt-0 pb-32">{children}</div>
|
|
10
|
+
</HomeLayout>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default Layout;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { Metadata } from "next";
|
|
2
|
+
import {
|
|
3
|
+
CommandPromptContent,
|
|
4
|
+
CommandPromptCopy,
|
|
5
|
+
CommandPromptList,
|
|
6
|
+
CommandPromptPrefix,
|
|
7
|
+
CommandPromptRoot,
|
|
8
|
+
CommandPromptSurface,
|
|
9
|
+
CommandPromptTrigger,
|
|
10
|
+
CommandPromptTriggerDivider,
|
|
11
|
+
CommandPromptViewport,
|
|
12
|
+
} from "@/components/ui/command-prompt";
|
|
13
|
+
import { CenteredSection } from "./components/centered-section";
|
|
14
|
+
import { CTA } from "./components/cta";
|
|
15
|
+
import { Hero } from "./components/hero";
|
|
16
|
+
import { OneTwoSection } from "./components/one-two-section";
|
|
17
|
+
import { Templates } from "./components/templates";
|
|
18
|
+
import { TextGridSection } from "./components/text-grid-section";
|
|
19
|
+
|
|
20
|
+
const title = "Geistdocs";
|
|
21
|
+
const description =
|
|
22
|
+
"A Vercel documentation template built with Next.js and Fumadocs. Designed for spinning up documentation sites quickly and consistently.";
|
|
23
|
+
|
|
24
|
+
export const metadata: Metadata = {
|
|
25
|
+
title,
|
|
26
|
+
description,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const templates = [
|
|
30
|
+
{
|
|
31
|
+
title: "Template 1",
|
|
32
|
+
description: "Description of template 1",
|
|
33
|
+
link: "https://example.com/template-1",
|
|
34
|
+
image: "https://placehold.co/600x400.png",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: "Template 2",
|
|
38
|
+
description: "Description of template 2",
|
|
39
|
+
link: "https://example.com/template-2",
|
|
40
|
+
image: "https://placehold.co/600x400.png",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: "Template 3",
|
|
44
|
+
description: "Description of template 3",
|
|
45
|
+
link: "https://example.com/template-3",
|
|
46
|
+
image: "https://placehold.co/600x400.png",
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
const textGridSection = [
|
|
51
|
+
{
|
|
52
|
+
id: "1",
|
|
53
|
+
title: "Text Grid Section",
|
|
54
|
+
description: "Description of text grid section",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "2",
|
|
58
|
+
title: "Text Grid Section",
|
|
59
|
+
description: "Description of text grid section",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "3",
|
|
63
|
+
title: "Text Grid Section",
|
|
64
|
+
description: "Description of text grid section",
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
const COMMAND_FOR_HUMANS = "npx @vercel/geistdocs init";
|
|
69
|
+
const COMMAND_FOR_AGENTS = "npx @vercel/geistdocs init --agent";
|
|
70
|
+
|
|
71
|
+
const HomePage = () => (
|
|
72
|
+
<div className="container mx-auto max-w-5xl">
|
|
73
|
+
<Hero
|
|
74
|
+
badge="Geistdocs is now in beta"
|
|
75
|
+
description={description}
|
|
76
|
+
title={title}
|
|
77
|
+
>
|
|
78
|
+
<CommandPromptRoot defaultValue="humans">
|
|
79
|
+
<CommandPromptList>
|
|
80
|
+
<CommandPromptTrigger className="min-w-[90px]" value="humans">
|
|
81
|
+
For humans
|
|
82
|
+
</CommandPromptTrigger>
|
|
83
|
+
<CommandPromptTriggerDivider />
|
|
84
|
+
<CommandPromptTrigger className="min-w-[84px]" value="agents">
|
|
85
|
+
For agents
|
|
86
|
+
</CommandPromptTrigger>
|
|
87
|
+
</CommandPromptList>
|
|
88
|
+
<CommandPromptSurface>
|
|
89
|
+
<CommandPromptPrefix>$</CommandPromptPrefix>
|
|
90
|
+
<CommandPromptViewport>
|
|
91
|
+
<CommandPromptContent copyValue={COMMAND_FOR_HUMANS} value="humans">
|
|
92
|
+
{COMMAND_FOR_HUMANS}
|
|
93
|
+
</CommandPromptContent>
|
|
94
|
+
<CommandPromptContent copyValue={COMMAND_FOR_AGENTS} value="agents">
|
|
95
|
+
{COMMAND_FOR_AGENTS}
|
|
96
|
+
</CommandPromptContent>
|
|
97
|
+
</CommandPromptViewport>
|
|
98
|
+
<CommandPromptCopy />
|
|
99
|
+
</CommandPromptSurface>
|
|
100
|
+
</CommandPromptRoot>
|
|
101
|
+
</Hero>
|
|
102
|
+
<div className="grid divide-y border-y sm:border-x">
|
|
103
|
+
<TextGridSection data={textGridSection} />
|
|
104
|
+
<CenteredSection
|
|
105
|
+
description="Description of centered section"
|
|
106
|
+
title="Centered Section"
|
|
107
|
+
>
|
|
108
|
+
<div className="aspect-video rounded-lg border bg-background" />
|
|
109
|
+
</CenteredSection>
|
|
110
|
+
<OneTwoSection
|
|
111
|
+
description="Description of one/two section"
|
|
112
|
+
title="One/Two Section"
|
|
113
|
+
>
|
|
114
|
+
<div className="aspect-video rounded-lg border bg-background" />
|
|
115
|
+
</OneTwoSection>
|
|
116
|
+
<Templates
|
|
117
|
+
data={templates}
|
|
118
|
+
description="See Geistdocs in action with one of our templates."
|
|
119
|
+
title="Get started quickly"
|
|
120
|
+
/>
|
|
121
|
+
<CTA cta="Get started" href="/docs" title="Start your docs today" />
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
export default HomePage;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createDocsPage } from "@vercel/geistdocs/pages/docs";
|
|
2
|
+
import { getMDXComponents } from "@/components/geistdocs/mdx-components";
|
|
3
|
+
import { MobileDocsBar } from "@/components/geistdocs/mobile-docs-bar";
|
|
4
|
+
import { config } from "@/lib/geistdocs/config";
|
|
5
|
+
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
6
|
+
|
|
7
|
+
const docsPage = createDocsPage({
|
|
8
|
+
config,
|
|
9
|
+
mdx: ({ link }) => getMDXComponents({ a: link }),
|
|
10
|
+
source: geistdocsSource,
|
|
11
|
+
tableOfContentPopover: {
|
|
12
|
+
enabled: false,
|
|
13
|
+
},
|
|
14
|
+
renderTop: ({ data }) => <MobileDocsBar toc={data.toc} />,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export default docsPage.Page;
|
|
18
|
+
export const generateStaticParams = docsPage.generateStaticParams;
|
|
19
|
+
export const generateMetadata = docsPage.generateMetadata;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DocsLayout } from "@/components/geistdocs/docs-layout";
|
|
2
|
+
import { source } from "@/lib/geistdocs/source";
|
|
3
|
+
|
|
4
|
+
const Layout = async ({ children, params }: LayoutProps<"/[lang]/docs">) => {
|
|
5
|
+
const { lang } = await params;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className="bg-background-200">
|
|
9
|
+
<DocsLayout tree={source.pageTree[lang]}>{children}</DocsLayout>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default Layout;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "../global.css";
|
|
2
|
+
import { Footer } from "@/components/geistdocs/footer";
|
|
3
|
+
import { Navbar } from "@/components/geistdocs/navbar";
|
|
4
|
+
import { GeistdocsProvider } from "@/components/geistdocs/provider";
|
|
5
|
+
import { basePath } from "@/geistdocs";
|
|
6
|
+
import { mono, sans } from "@/lib/geistdocs/fonts";
|
|
7
|
+
import { cn } from "@/lib/utils";
|
|
8
|
+
|
|
9
|
+
const Layout = async ({ children, params }: LayoutProps<"/[lang]">) => {
|
|
10
|
+
const { lang } = await params;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<html
|
|
14
|
+
className={cn(sans.variable, mono.variable, "antialiased")}
|
|
15
|
+
lang={lang}
|
|
16
|
+
suppressHydrationWarning
|
|
17
|
+
>
|
|
18
|
+
<body>
|
|
19
|
+
<GeistdocsProvider basePath={basePath} lang={lang}>
|
|
20
|
+
<Navbar />
|
|
21
|
+
{children}
|
|
22
|
+
<Footer />
|
|
23
|
+
</GeistdocsProvider>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default Layout;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { ImageResponse } from "next/og";
|
|
4
|
+
import type { NextRequest } from "next/server";
|
|
5
|
+
import { getPageImage, source } from "@/lib/geistdocs/source";
|
|
6
|
+
|
|
7
|
+
export const GET = async (
|
|
8
|
+
_request: NextRequest,
|
|
9
|
+
{ params }: RouteContext<"/[lang]/og/[...slug]">
|
|
10
|
+
) => {
|
|
11
|
+
const { slug, lang } = await params;
|
|
12
|
+
const page = source.getPage(slug.slice(0, -1), lang);
|
|
13
|
+
|
|
14
|
+
if (!page) {
|
|
15
|
+
return new Response("Not found", { status: 404 });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { title, description } = page.data;
|
|
19
|
+
|
|
20
|
+
const regularFont = await readFile(
|
|
21
|
+
join(process.cwd(), "app/[lang]/og/[...slug]/geist-sans-regular.ttf")
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const semiboldFont = await readFile(
|
|
25
|
+
join(process.cwd(), "app/[lang]/og/[...slug]/geist-sans-semibold.ttf")
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const backgroundImage = await readFile(
|
|
29
|
+
join(process.cwd(), "app/[lang]/og/[...slug]/background.png")
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const backgroundImageData = backgroundImage.buffer.slice(
|
|
33
|
+
backgroundImage.byteOffset,
|
|
34
|
+
backgroundImage.byteOffset + backgroundImage.byteLength
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return new ImageResponse(
|
|
38
|
+
<div style={{ fontFamily: "Geist" }} tw="flex h-full w-full bg-black">
|
|
39
|
+
{/** biome-ignore lint/performance/noImgElement: "Required for Satori" */}
|
|
40
|
+
<img
|
|
41
|
+
alt="Vercel OpenGraph Background"
|
|
42
|
+
height={628}
|
|
43
|
+
src={backgroundImageData as never}
|
|
44
|
+
width={1200}
|
|
45
|
+
/>
|
|
46
|
+
<div tw="flex flex-col absolute h-full w-[750px] justify-center left-[50px] pr-[50px] pt-[116px] pb-[86px]">
|
|
47
|
+
<div
|
|
48
|
+
style={{
|
|
49
|
+
textWrap: "balance",
|
|
50
|
+
}}
|
|
51
|
+
tw="text-5xl font-medium text-white tracking-tight flex leading-[1.1] mb-4"
|
|
52
|
+
>
|
|
53
|
+
{title}
|
|
54
|
+
</div>
|
|
55
|
+
<div
|
|
56
|
+
style={{
|
|
57
|
+
color: "#8B8B8B",
|
|
58
|
+
lineHeight: "44px",
|
|
59
|
+
textWrap: "balance",
|
|
60
|
+
}}
|
|
61
|
+
tw="text-[32px]"
|
|
62
|
+
>
|
|
63
|
+
{description}
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>,
|
|
67
|
+
{
|
|
68
|
+
width: 1200,
|
|
69
|
+
height: 628,
|
|
70
|
+
fonts: [
|
|
71
|
+
{
|
|
72
|
+
name: "Geist",
|
|
73
|
+
data: regularFont,
|
|
74
|
+
weight: 400,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "Geist",
|
|
78
|
+
data: semiboldFont,
|
|
79
|
+
weight: 500,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const generateStaticParams = async ({
|
|
87
|
+
params,
|
|
88
|
+
}: RouteContext<"/[lang]/og/[...slug]">) => {
|
|
89
|
+
const { lang } = await params;
|
|
90
|
+
|
|
91
|
+
return source.getPages(lang).map((page) => ({
|
|
92
|
+
lang: page.locale,
|
|
93
|
+
slug: getPageImage(page).segments,
|
|
94
|
+
}));
|
|
95
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Feed } from "feed";
|
|
2
|
+
import type { NextRequest } from "next/server";
|
|
3
|
+
import { title } from "@/geistdocs";
|
|
4
|
+
import { source } from "@/lib/geistdocs/source";
|
|
5
|
+
|
|
6
|
+
const protocol = process.env.NODE_ENV === "production" ? "https" : "http";
|
|
7
|
+
const baseUrl = `${protocol}://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`;
|
|
8
|
+
|
|
9
|
+
export const revalidate = false;
|
|
10
|
+
|
|
11
|
+
export const GET = async (
|
|
12
|
+
_req: NextRequest,
|
|
13
|
+
{ params }: RouteContext<"/[lang]/rss.xml">
|
|
14
|
+
) => {
|
|
15
|
+
const { lang } = await params;
|
|
16
|
+
const feed = new Feed({
|
|
17
|
+
title,
|
|
18
|
+
id: baseUrl,
|
|
19
|
+
link: baseUrl,
|
|
20
|
+
language: lang,
|
|
21
|
+
copyright: `All rights reserved ${new Date().getFullYear()}, Vercel`,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
for (const page of source.getPages(lang)) {
|
|
25
|
+
const data = page.data as {
|
|
26
|
+
description?: string;
|
|
27
|
+
lastModified?: Date;
|
|
28
|
+
title?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
feed.addItem({
|
|
32
|
+
id: page.url,
|
|
33
|
+
title: data.title ?? page.url,
|
|
34
|
+
description: data.description,
|
|
35
|
+
link: `${baseUrl}${page.url}`,
|
|
36
|
+
date: new Date(data.lastModified ?? new Date()),
|
|
37
|
+
author: [
|
|
38
|
+
{
|
|
39
|
+
name: "Vercel",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const rss = feed.rss2();
|
|
46
|
+
|
|
47
|
+
return new Response(rss, {
|
|
48
|
+
headers: {
|
|
49
|
+
"Content-Type": "application/rss+xml",
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createSitemapMarkdownRoute } from "@vercel/geistdocs/routes/sitemap";
|
|
2
|
+
import { config } from "@/lib/geistdocs/config";
|
|
3
|
+
import { source } from "@/lib/geistdocs/source";
|
|
4
|
+
|
|
5
|
+
export const { GET, generateStaticParams, revalidate, dynamic } =
|
|
6
|
+
createSitemapMarkdownRoute({
|
|
7
|
+
config,
|
|
8
|
+
source,
|
|
9
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
|
|
3
|
+
import { headers } from "next/headers";
|
|
4
|
+
import type { Feedback } from "@/components/geistdocs/feedback";
|
|
5
|
+
import { siteId } from "@/geistdocs";
|
|
6
|
+
import { emotions } from "./emotions";
|
|
7
|
+
|
|
8
|
+
const protocol = process.env.NODE_ENV === "production" ? "https" : "http";
|
|
9
|
+
const baseUrl = `${protocol}://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`;
|
|
10
|
+
|
|
11
|
+
export const sendFeedback = async (
|
|
12
|
+
url: string,
|
|
13
|
+
feedback: Feedback
|
|
14
|
+
): Promise<{ success: boolean }> => {
|
|
15
|
+
const emoji = emotions.find((e) => e.name === feedback.emotion)?.emoji;
|
|
16
|
+
const endpoint = new URL("/feedback", "https://geistdocs.com/feedback");
|
|
17
|
+
const headersList = await headers();
|
|
18
|
+
|
|
19
|
+
const response = await fetch(endpoint, {
|
|
20
|
+
method: "POST",
|
|
21
|
+
headers: {
|
|
22
|
+
"Content-Type": "application/json",
|
|
23
|
+
},
|
|
24
|
+
body: JSON.stringify({
|
|
25
|
+
note: feedback.message,
|
|
26
|
+
url: new URL(url, baseUrl).toString(),
|
|
27
|
+
emotion: emoji,
|
|
28
|
+
ua: headersList.get("user-agent") ?? undefined,
|
|
29
|
+
ip: headersList.get("x-real-ip") || headersList.get("x-forwarded-for"),
|
|
30
|
+
label: siteId,
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
if (!response.ok) {
|
|
35
|
+
const error = await response.json();
|
|
36
|
+
|
|
37
|
+
console.error(error);
|
|
38
|
+
|
|
39
|
+
return { success: false };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
success: true,
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createChatRoute } from "@vercel/geistdocs/routes/chat";
|
|
2
|
+
import { config } from "@/lib/geistdocs/config";
|
|
3
|
+
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
4
|
+
|
|
5
|
+
export const { POST, maxDuration } = createChatRoute({
|
|
6
|
+
config,
|
|
7
|
+
source: geistdocsSource,
|
|
8
|
+
});
|
|
Binary file
|