Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenUI

[Docs](https://openui.com) · [Example App](./examples/openui-chat) · [Contributing](./CONTRIBUTING.md) · [License](./LICENSE)
[Docs](https://www.openui.com) · [Example App](./examples/openui-chat) · [Contributing](./CONTRIBUTING.md) · [License](./LICENSE)

Build **LLM-powered user interfaces** with OpenUI Lang, streaming rendering, and generative UI.

Expand Down
3 changes: 2 additions & 1 deletion docs/app/api/playground/stream/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type NextRequest } from "next/server";
import { BASE_URL } from "@/lib/source";

export async function POST(req: NextRequest) {
const { model, prompt, systemPrompt } = await req.json();
Expand All @@ -8,7 +9,7 @@ export async function POST(req: NextRequest) {
headers: {
Authorization: `Bearer ${process.env.OPENROUTER_API_KEY}`,
"Content-Type": "application/json",
"HTTP-Referer": "https://openui.com/playground",
"HTTP-Referer": `${BASE_URL}/playground`,
"X-Title": "OpenUI Playground",
},
body: JSON.stringify({
Expand Down
3 changes: 3 additions & 0 deletions docs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ import { Inter } from "next/font/google";
import Script from "next/script";
import "./global.css";
import { PHProvider } from "./providers";
import { BASE_URL } from "../lib/source";

const inter = Inter({
subsets: ["latin"],
});

export const metadata: Metadata = {
metadataBase: new URL(BASE_URL),
title: {
default: "OpenUI",
template: "%s | OpenUI",
},
description: "The Open Standard for Generative UI",
icons: {
icon: "/favicon.svg",
shortcut: "/favicon.svg",
Expand Down
12 changes: 12 additions & 0 deletions docs/app/robots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { BASE_URL } from "@/lib/source";
import type { MetadataRoute } from "next";

export default function robots(): MetadataRoute.Robots {
return {
rules: {
userAgent: "*",
allow: "/",
},
sitemap: `${BASE_URL}/sitemap.xml`,
};
}
19 changes: 19 additions & 0 deletions docs/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { BASE_URL, source } from "@/lib/source";

const STATIC_PATHS = ["/", "/playground"];

export default async function sitemap() {
const staticRoutes = STATIC_PATHS.map((path) => ({
url: `${BASE_URL}${path}`,
lastModified: new Date(),
changeFrequency: "weekly" as const,
}));

const docsRoutes = source.getPages().map((page) => ({
url: `${BASE_URL}${page.url}`,
lastModified: page.data.lastModified,
changeFrequency: "weekly" as const,
}));

return [...staticRoutes, ...docsRoutes];
}
2 changes: 2 additions & 0 deletions docs/lib/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { type InferPageType, loader } from "fumadocs-core/source";
import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons";
import { docs } from "fumadocs-mdx:collections/server";

export const BASE_URL = "https://www.openui.com";

// See https://fumadocs.dev/docs/headless/source-api for more info
export const source = loader({
baseUrl: "/docs",
Expand Down
5 changes: 2 additions & 3 deletions docs/source.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
import lastModified from "fumadocs-mdx/plugins/last-modified";

// You can customise Zod schemas for frontmatter and `meta.json` here
// see https://fumadocs.dev/docs/mdx/collections
Expand All @@ -17,7 +18,5 @@ export const docs = defineDocs({
});

export default defineConfig({
mdxOptions: {
// MDX options
},
plugins: [lastModified()],
});