Skip to content

feat(www): add basic layout including header, footer and meta #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025
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
16 changes: 16 additions & 0 deletions apps/www/app/(home)/changelog/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Changelog from "@/components/ui/changelog";
import { SubscriptionForm } from "@/components/ui/subscription-form";

export const metadata = {
title: "Changelog",
description: "Get the latest product updates and changes to Amical.",
};

export default function ChangelogPage() {
return (
<>
<Changelog />
</>
);
}

10 changes: 10 additions & 0 deletions apps/www/app/(home)/contact/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Contact from "@/components/ui/contact";

export const metadata = {
title: "Contact",
description: "Get in touch with the authors of Amical for any questions or support.",
};

export default function ContactPage() {
return <Contact />;
}
24 changes: 13 additions & 11 deletions apps/www/app/(home)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import type { ReactNode } from 'react';
import { HomeLayout } from 'fumadocs-ui/layouts/home';
import { baseOptions } from '@/app/layout.config';
import { Footer } from '@/components/ui/footer';

export default function Layout({ children }: { children: ReactNode }) {
export default function Layout({
children,
}: {
children: ReactNode;
}): React.ReactElement {
return (
<HomeLayout
{...baseOptions}
links={[
{
text: 'Documentation',
url: '/docs',
},
]}
>
{children}
<HomeLayout {...baseOptions}>
<div className="fixed inset-0 pointer-events-none">
</div>
<div className="relative min-h-screen w-full">
{children}
<Footer />
</div>
</HomeLayout>
);
}
17 changes: 2 additions & 15 deletions apps/www/app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
import Link from 'next/link';

export default function HomePage() {
return (
<main className="flex flex-1 flex-col justify-center text-center">
<h1 className="mb-4 text-2xl font-bold">Hello World</h1>
<p className="text-fd-muted-foreground">
You can open{' '}
<Link
href="/docs"
className="text-fd-foreground font-semibold underline"
>
/docs
</Link>{' '}
and see the documentation.
</p>
<main className="flex flex-1 flex-col">
</main>
);
}
}
5 changes: 4 additions & 1 deletion apps/www/app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { source } from '@/lib/source';
import { createFromSource } from 'fumadocs-core/search/server';

export const { GET } = createFromSource(source);
// it should be cached forever
export const revalidate = false;

export const { staticGET: GET } = createFromSource(source);
5 changes: 5 additions & 0 deletions apps/www/app/community/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { redirect } from 'next/navigation';

export default async function CommunityPage() {
redirect('https://discord.gg/x7pGh8Q34e')
}
5 changes: 5 additions & 0 deletions apps/www/app/github/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { redirect } from 'next/navigation';

export default async function CommunityPage() {
redirect('https://github.com/amicalhq/amical')
}
119 changes: 119 additions & 0 deletions apps/www/app/global.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,122 @@
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

@theme inline {
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}

:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}

.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
}

@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
46 changes: 37 additions & 9 deletions apps/www/app/layout.config.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import Image from 'next/image';

/**
* Shared layout configurations
Expand All @@ -8,19 +9,46 @@ import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
* Docs Layout: app/docs/layout.tsx
*/
export const baseOptions: BaseLayoutProps = {
githubUrl: 'https://github.com/amicalhq/amical',
disableThemeSwitch: true,
nav: {
title: (
<>
<svg
width="24"
height="24"
xmlns="http://www.w3.org/2000/svg"
aria-label="Logo"
>
<circle cx={12} cy={12} r={12} fill="currentColor" />
</svg>
My App
<Image
src="/amical-icon.svg"
width={32}
height={32}
alt="Amical Logo"
/>
Amical
</>
),
},
links: [
{
text: 'Docs',
url: '/docs',
},
{
text: 'Contact',
url: '/contact',
active: 'nested-url',
},
{
text: 'Changelog',
url: '/changelog',
active: 'nested-url',
},
{
type: 'icon',
url: '/community',
text: 'Discord',
icon: (
<svg role="img" viewBox="0 0 24 24" fill="currentColor">
<path d="M19.27 5.33C17.94 4.71 16.5 4.26 15 4a.09.09 0 0 0-.07.03c-.18.33-.39.76-.53 1.09a16.09 16.09 0 0 0-4.8 0c-.14-.34-.35-.76-.54-1.09c-.01-.02-.04-.03-.07-.03c-1.5.26-2.93.71-4.27 1.33c-.01 0-.02.01-.03.02c-2.72 4.07-3.47 8.03-3.1 11.95c0 .02.01.04.03.05c1.8 1.32 3.53 2.12 5.24 2.65c.03.01.06 0 .07-.02c.4-.55.76-1.13 1.07-1.74c.02-.04 0-.08-.04-.09c-.57-.22-1.11-.48-1.64-.78c-.04-.02-.04-.08-.01-.11c.11-.08.22-.17.33-.25c.02-.02.05-.02.07-.01c3.44 1.57 7.15 1.57 10.55 0c.02-.01.05-.01.07.01c.11.09.22.17.33.26c.04.03.04.09-.01.11c-.52.31-1.07.56-1.64.78c-.04.01-.05.06-.04.09c.32.61.68 1.19 1.07 1.74c.03.01.06.02.09.01c1.72-.53 3.45-1.33 5.25-2.65c.02-.01.03-.03.03-.05c.44-4.53-.73-8.46-3.1-11.95c-.01-.01-.02-.02-.04-.02zM8.52 14.91c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.84 2.12-1.89 2.12zm6.97 0c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.83 2.12-1.89 2.12z"/>
</svg>
),
external: true,
},
],
};
32 changes: 30 additions & 2 deletions apps/www/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import './global.css';
import { RootProvider } from 'fumadocs-ui/provider';
import { Inter } from 'next/font/google';
import type { ReactNode } from 'react';
import PlausibleProvider from 'next-plausible';
import { GoogleTagManager } from '@next/third-parties/google'
import { createMetadata } from '@/lib/metadata';
import { TooltipProvider } from '@radix-ui/react-tooltip';


export const metadata = createMetadata({});

const inter = Inter({
subsets: ['latin'],
Expand All @@ -10,9 +17,30 @@ const inter = Inter({
export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en" className={inter.className} suppressHydrationWarning>
<head>
<PlausibleProvider
domain="amical.ai"
trackOutboundLinks={true}
trackFileDownloads={true}
taggedEvents={true}
hash={true}
/>
</head>
<body className="flex flex-col min-h-screen">
<RootProvider>{children}</RootProvider>
<RootProvider
search={{
options: {
type: 'static',
}
}}
theme={{
defaultTheme: 'dark',
}}>
<TooltipProvider>
{children}
</TooltipProvider>
</RootProvider>
</body>
</html>
);
}
}
Loading