Skip to content

Commit 072a8be

Browse files
authored
feat: add Plausible Analytics tracking to UP Kit (#224)
1 parent 7dbc91d commit 072a8be

File tree

97 files changed

+2098
-1622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2098
-1622
lines changed

apps/kit/app/(home)/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ export default function HomePage() {
3131
UP Kit
3232
</h1>
3333
<p className="text-xl md:text-2xl text-muted-foreground mb-8 max-w-3xl mx-auto">
34-
Ship better UX than most design teams. Without the meetings. Production-ready components with all the UX decisions already made. Every pattern, animation, and interaction battle-tested. Copy the excellence, skip the committees.
34+
Ship better UX than most design teams. Without the meetings.
35+
Production-ready components with all the UX decisions already made.
36+
Every pattern, animation, and interaction battle-tested. Copy the
37+
excellence, skip the committees.
3538
</p>
3639
<div className="flex flex-col sm:flex-row gap-4 justify-center mb-12">
3740
<Button asChild size="lg">

apps/kit/app/docs/[[...slug]]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import {
77
} from "fumadocs-ui/page";
88
import type { Metadata } from "next";
99
import { notFound } from "next/navigation";
10+
import { LLMCopyButton, ViewOptions } from "@/components/page-actions";
1011
import { source } from "@/lib/source";
1112
import { getMDXComponents } from "@/mdx-components";
12-
import { LLMCopyButton, ViewOptions } from "@/components/page-actions";
1313

1414
export default async function Page(props: PageProps<"/docs/[[...slug]]">) {
1515
const params = await props.params;

apps/kit/app/global.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
--sidebar-ring: 0 0% 83.1%;
9090
}
9191

92-
9392
@theme inline {
9493
--font-sans: var(--font-geist-sans);
9594
--font-mono: var(--font-geist-mono);

apps/kit/app/layout.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import "@/app/global.css";
22
import { RootProvider } from "fumadocs-ui/provider";
33
import type { Metadata } from "next";
44
import { Inter } from "next/font/google";
5+
import PlausibleProvider from "next-plausible";
56

67
const inter = Inter({
78
subsets: ["latin"],
@@ -25,6 +26,13 @@ export const metadata = {
2526
export default function Layout({ children }: LayoutProps<"/">) {
2627
return (
2728
<html lang="en" className={inter.className} suppressHydrationWarning>
29+
<head>
30+
<PlausibleProvider
31+
domain="kit.uxpatterns.dev"
32+
trackOutboundLinks={true}
33+
taggedEvents={true}
34+
/>
35+
</head>
2836
<body className="flex flex-col min-h-screen">
2937
<RootProvider
3038
search={{
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { source } from '@/lib/source';
2-
import { getLLMText } from '@/lib/get-llm-text';
1+
import { getLLMText } from "@/lib/get-llm-text";
2+
import { source } from "@/lib/source";
33

44
// cached forever
55
export const revalidate = false;
66

77
export async function GET() {
8-
const scan = source.getPages().map(getLLMText);
9-
const scanned = await Promise.all(scan);
8+
const scan = source.getPages().map(getLLMText);
9+
const scanned = await Promise.all(scan);
1010

11-
return new Response(scanned.join('\n\n'));
11+
return new Response(scanned.join("\n\n"));
1212
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { type NextRequest, NextResponse } from 'next/server';
2-
import { getLLMText } from '@/lib/get-llm-text';
3-
import { source } from '@/lib/source';
4-
import { notFound } from 'next/navigation';
1+
import { notFound } from "next/navigation";
2+
import { type NextRequest, NextResponse } from "next/server";
3+
import { getLLMText } from "@/lib/get-llm-text";
4+
import { source } from "@/lib/source";
55
export const revalidate = false;
66
export async function GET(
7-
_req: NextRequest,
8-
{ params }: { params: Promise<{ slug?: string[] }> },
7+
_req: NextRequest,
8+
{ params }: { params: Promise<{ slug?: string[] }> },
99
) {
10-
const { slug } = await params;
11-
const page = source.getPage(slug);
12-
if (!page) notFound();
13-
return new NextResponse(await getLLMText(page));
10+
const { slug } = await params;
11+
const page = source.getPage(slug);
12+
if (!page) notFound();
13+
return new NextResponse(await getLLMText(page));
1414
}
1515
export function generateStaticParams() {
16-
return source.generateParams();
16+
return source.generateParams();
1717
}

apps/kit/app/manifest.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
2-
"name": "MyWebSite",
3-
"short_name": "MySite",
4-
"icons": [
5-
{
6-
"src": "/web-app-manifest-192x192.png",
7-
"sizes": "192x192",
8-
"type": "image/png",
9-
"purpose": "maskable"
10-
},
11-
{
12-
"src": "/web-app-manifest-512x512.png",
13-
"sizes": "512x512",
14-
"type": "image/png",
15-
"purpose": "maskable"
16-
}
17-
],
18-
"theme_color": "#ffffff",
19-
"background_color": "#ffffff",
20-
"display": "standalone"
21-
}
2+
"name": "MyWebSite",
3+
"short_name": "MySite",
4+
"icons": [
5+
{
6+
"src": "/web-app-manifest-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png",
9+
"purpose": "maskable"
10+
},
11+
{
12+
"src": "/web-app-manifest-512x512.png",
13+
"sizes": "512x512",
14+
"type": "image/png",
15+
"purpose": "maskable"
16+
}
17+
],
18+
"theme_color": "#ffffff",
19+
"background_color": "#ffffff",
20+
"display": "standalone"
21+
}

apps/kit/cli.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"aliases": {
3-
"uiDir": "./components/ui",
4-
"componentsDir": "./components",
5-
"blockDir": "./components",
6-
"cssDir": "./styles",
7-
"libDir": "./lib"
8-
},
9-
"baseDir": "",
10-
"commands": {}
11-
}
2+
"aliases": {
3+
"uiDir": "./components/ui",
4+
"componentsDir": "./components",
5+
"blockDir": "./components",
6+
"cssDir": "./styles",
7+
"libDir": "./lib"
8+
},
9+
"baseDir": "",
10+
"commands": {}
11+
}

0 commit comments

Comments
 (0)