docs: add llms
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
|
||||
import { OPENPANEL_BASE_URL, OPENPANEL_NAME } from './openpanel-brand';
|
||||
|
||||
export const siteName = 'OpenPanel';
|
||||
export const siteName = OPENPANEL_NAME;
|
||||
export const baseUrl =
|
||||
process.env.NODE_ENV === 'production'
|
||||
? 'https://openpanel.dev'
|
||||
? OPENPANEL_BASE_URL
|
||||
: 'http://localhost:3000';
|
||||
export const url = (path: string) => {
|
||||
if (path.startsWith('http')) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { Metadata } from 'next';
|
||||
import { OPENPANEL_DESCRIPTION, OPENPANEL_NAME } from './openpanel-brand';
|
||||
import { url as baseUrl } from './layout.shared';
|
||||
|
||||
const siteName = 'OpenPanel';
|
||||
const defaultDescription =
|
||||
'OpenPanel is a simple, affordable open-source alternative to Mixpanel for web and product analytics. Get powerful insights without the complexity.';
|
||||
const siteName = OPENPANEL_NAME;
|
||||
const defaultDescription = OPENPANEL_DESCRIPTION;
|
||||
const defaultImage = baseUrl('/ogimage.png');
|
||||
|
||||
export function getOgImageUrl(url: string): string {
|
||||
|
||||
4
apps/public/src/lib/openpanel-brand.ts
Normal file
4
apps/public/src/lib/openpanel-brand.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export const OPENPANEL_NAME = 'OpenPanel';
|
||||
export const OPENPANEL_BASE_URL = 'https://openpanel.dev';
|
||||
export const OPENPANEL_DESCRIPTION =
|
||||
'OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.';
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
import { type InferPageType, loader } from 'fumadocs-core/source';
|
||||
import { lucideIconsPlugin } from 'fumadocs-core/source/lucide-icons';
|
||||
import { toFumadocsSource } from 'fumadocs-mdx/runtime/server';
|
||||
import { OPENPANEL_BASE_URL } from './openpanel-brand';
|
||||
import type { CompareData } from './compare';
|
||||
import type { FeatureData } from './features';
|
||||
import { loadFeatureSourceSync } from './features';
|
||||
@@ -49,8 +50,11 @@ export function getPageImage(page: InferPageType<typeof source>) {
|
||||
|
||||
export async function getLLMText(page: InferPageType<typeof source>) {
|
||||
const processed = await page.data.getText('processed');
|
||||
const canonical = `${OPENPANEL_BASE_URL}${page.url}`;
|
||||
|
||||
return `# ${page.data.title}
|
||||
return `---
|
||||
## ${page.data.title}
|
||||
URL: ${canonical}
|
||||
|
||||
${processed}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user