File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { createOpenRouter } from '@openrouter/ai-sdk-provider';
22import { streamText , tool , type UIMessage } from 'ai' ;
33import { z } from 'zod' ;
44import { liteClient } from 'algoliasearch/lite' ;
5+ import { siteConfig } from '@/lib/config' ;
56
67const algolia = liteClient (
78 process . env . NEXT_PUBLIC_ALGOLIA_APP_ID ! ,
@@ -72,7 +73,7 @@ const openrouter = createOpenRouter({
7273} ) ;
7374
7475const systemPrompt = [
75- ' You are a helpful technical assistant for Next Commerce developer documentation.' ,
76+ ` You are a helpful technical assistant for ${ siteConfig . companyName } developer documentation.` ,
7677 'Your job is to answer developer questions clearly and concisely based on the documentation provided in context.' ,
7778 'Base your answers on the documentation context below. Cite sources as markdown links using the document URL.' ,
7879 'When writing code examples, use the language shown in the documentation.' ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { getMDXComponents } from '@/components/mdx';
1111import { createRelativeLink } from 'fumadocs-ui/mdx' ;
1212import { VersionSelector } from '@/components/version-selector' ;
1313import { AutoExpandBody } from '@/components/auto-expand-body' ;
14+ import { siteConfig } from '@/lib/config' ;
1415import type { Metadata } from 'next' ;
1516
1617export default async function Page ( props : {
@@ -30,7 +31,7 @@ export default async function Page(props: {
3031 < ViewOptionsPopover
3132 className = "flex items-center gap-2 rounded-lg p-2 border bg-fd-secondary/50 text-sm text-fd-secondary-foreground transition-colors hover:bg-fd-accent h-auto"
3233 markdownUrl = { `/docs-raw/${ ( params . slug ?? [ ] ) . join ( '/' ) } ` }
33- githubUrl = { `https://github.com/29next/developer-docs/blob/main/content/docs /${ page . path } ` }
34+ githubUrl = { `${ siteConfig . githubContentUrl } /${ page . path } ` }
3435 />
3536 < VersionSelector />
3637 </ div >
Original file line number Diff line number Diff line change @@ -2,14 +2,15 @@ import { RootProvider } from 'fumadocs-ui/provider/next';
22import { AlgoliaDialog } from '@/components/search' ;
33import { AISearch , AISearchPanel , AISearchTrigger } from '@/components/ai/search' ;
44import { MessageCircleIcon } from 'lucide-react' ;
5+ import { siteConfig } from '@/lib/config' ;
56import type { Metadata } from 'next' ;
67import type { ReactNode } from 'react' ;
78import './globals.css' ;
89
910export const metadata : Metadata = {
1011 title : {
11- template : ' %s | Developers | Next Commerce' ,
12- default : ' Developers | Next Commerce' ,
12+ template : ` %s | Developers | ${ siteConfig . companyName } ` ,
13+ default : ` Developers | ${ siteConfig . companyName } ` ,
1314 } ,
1415} ;
1516
Original file line number Diff line number Diff line change @@ -232,9 +232,11 @@ function Input(props: ComponentProps<'textarea'>) {
232232 ) ;
233233}
234234
235+ import { siteConfig } from '@/lib/config' ;
236+
235237const roleName : Record < string , string > = {
236238 user : 'you' ,
237- assistant : 'Next Commerce AI' ,
239+ assistant : ` ${ siteConfig . companyName } AI` ,
238240} ;
239241
240242function Message ( { message, ...props } : { message : UIMessage } & ComponentProps < 'div' > ) {
Original file line number Diff line number Diff line change 1+ export const siteConfig = {
2+ companyName : 'Next Commerce' ,
3+ githubOrg : 'NextCommerceCo' ,
4+ githubRepo : 'developer-docs' ,
5+ get githubUrl ( ) {
6+ return `https://github.com/${ this . githubOrg } /${ this . githubRepo } ` ;
7+ } ,
8+ get githubContentUrl ( ) {
9+ return `${ this . githubUrl } /blob/main/content/docs` ;
10+ } ,
11+ } ;
Original file line number Diff line number Diff line change 11import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared' ;
22import Image from 'next/image' ;
3+ import { siteConfig } from '@/lib/config' ;
34
45export function baseOptions ( ) : BaseLayoutProps {
56 return {
67 nav : {
78 title : (
89 < >
9- < Image src = "/logo-light.png" alt = "Next Commerce" width = { 105 } height = { 21 } className = "dark:hidden" />
10- < Image src = "/logo-dark.png" alt = "Next Commerce" width = { 105 } height = { 21 } className = "hidden dark:block" />
10+ < Image src = "/logo-light.png" alt = { siteConfig . companyName } width = { 105 } height = { 21 } className = "dark:hidden" />
11+ < Image src = "/logo-dark.png" alt = { siteConfig . companyName } width = { 105 } height = { 21 } className = "hidden dark:block" />
1112 </ >
1213 ) ,
1314 } ,
14- githubUrl : 'https://github.com/NextCommerceCo/developer-docs' ,
15+ githubUrl : siteConfig . githubUrl ,
1516 } ;
1617}
Original file line number Diff line number Diff line change 11/// <reference types="next" />
22/// <reference types="next/image-types/global" />
3- import "./.next/dev/ types/routes.d.ts" ;
3+ import "./.next/types/routes.d.ts" ;
44
55// NOTE: This file should not be edited
66// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
You can’t perform that action at this time.
0 commit comments