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
4 changes: 2 additions & 2 deletions apps/web/app/(main)/(docs)/[category]/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export default async function ArticlePage({
<div className="min-w-0 flex-1 px-8 py-10 lg:px-12 xl:max-w-4xl">
{/* Breadcrumb */}
<nav className="mb-6 flex items-center gap-1.5 text-sm text-muted-foreground">
<Link href="/" className="transition-colors hover:text-foreground">
Home
<Link href="/docs" className="transition-colors hover:text-foreground">
Docs
</Link>
<ChevronIcon />
<Link
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/(main)/(docs)/[category]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export default async function CategoryPage({
<div className="max-w-5xl px-8 py-10 lg:px-12">
{/* Breadcrumb */}
<nav className="mb-6 flex items-center gap-1.5 text-sm text-muted-foreground">
<Link href="/" className="transition-colors hover:text-foreground">
Home
<Link href="/docs" className="transition-colors hover:text-foreground">
Docs
</Link>
<ChevronIcon />
<span className="text-foreground">{category.title}</span>
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions apps/web/app/(main)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Header } from "@/components/header"
import { HeaderDocs } from "@/components/header-docs"
import { Footer } from "@/components/footer"
import { SearchDialog } from "@/components/search-dialog"
import { getSearchIndex } from "@/lib/search"
Expand All @@ -13,7 +13,7 @@ export default async function MainLayout({
return (
<>
<div className="flex min-h-svh flex-col">
<Header />
<HeaderDocs />
<main className="flex-1">{children}</main>
<Footer />
</div>
Expand Down
15 changes: 15 additions & 0 deletions apps/web/app/(marketing)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Marketing layout — intentionally bare. The (marketing) route group
* stays out of the docs UX (no sidebar, no SearchDialog, no Footer
* with docs links). Marketing pages own their own header + footer
* via the components they install (e.g. Tailark blocks).
*
* Global html/body/ThemeProvider come from app/layout.tsx.
*/
export default function MarketingLayout({
children,
}: Readonly<{
children: React.ReactNode
}>) {
return <>{children}</>
}
5 changes: 5 additions & 0 deletions apps/web/app/(marketing)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import HeroSection from "@/components/hero-section"

export default function LandingPage() {
return <HeroSection />
}
2 changes: 1 addition & 1 deletion apps/web/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"hooks": "@/hooks",
"lib": "@/lib",
"utils": "@workspace/ui/lib/utils",
"ui": "@workspace/ui/components"
"ui": "@/components/ui"
},
"rtl": false,
"menuColor": "inverted-translucent",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function Footer() {
<p>
Built with{" "}
<Link
href="/"
href="/docs"
className="font-medium text-foreground underline-offset-4 hover:underline"
>
helpbase
Expand Down
160 changes: 160 additions & 0 deletions apps/web/components/header-docs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
"use client"

import Link from "next/link"
import { useTheme } from "next-themes"
import { useEffect, useState } from "react"

function SearchTrigger() {
return (
<button
type="button"
className="group flex h-9 w-full max-w-sm items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 text-sm text-muted-foreground transition-[border-color,background-color] duration-150 ease hover:border-foreground/20 hover:bg-muted/60 sm:w-64"
onClick={() => {
window.dispatchEvent(
new KeyboardEvent("keydown", {
key: "k",
metaKey: true,
bubbles: true,
})
)
}}
>
<SearchIcon className="size-4 shrink-0 opacity-50" />
<span className="flex-1 text-left">Search articles...</span>
<kbd className="pointer-events-none hidden h-5 items-center gap-0.5 rounded border border-border bg-background px-1.5 font-mono text-[10px] font-medium text-muted-foreground sm:flex">
<span className="text-xs">&#8984;</span>K
</kbd>
</button>
)
}

function ThemeToggle() {
const { resolvedTheme, setTheme } = useTheme()
const [mounted, setMounted] = useState(false)

useEffect(() => setMounted(true), [])

return (
<button
type="button"
onClick={() => setTheme(resolvedTheme === "dark" ? "light" : "dark")}
className="inline-flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
aria-label="Toggle theme"
>
{mounted ? (
resolvedTheme === "dark" ? (
<SunIcon className="size-4" />
) : (
<MoonIcon className="size-4" />
)
) : (
<div className="size-4" />
)}
</button>
)
}

function SearchIcon({ className }: { className?: string }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className={className}
>
<circle cx="11" cy="11" r="8" />
<path d="m21 21-4.3-4.3" />
</svg>
)
}

function SunIcon({ className }: { className?: string }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className={className}
>
<circle cx="12" cy="12" r="4" />
<path d="M12 2v2" />
<path d="M12 20v2" />
<path d="m4.93 4.93 1.41 1.41" />
<path d="m17.66 17.66 1.41 1.41" />
<path d="M2 12h2" />
<path d="M20 12h2" />
<path d="m6.34 17.66-1.41 1.41" />
<path d="m19.07 4.93-1.41 1.41" />
</svg>
)
}

function MoonIcon({ className }: { className?: string }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className={className}
>
<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" />
</svg>
)
}

function GitHubIcon({ className }: { className?: string }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
className={className}
>
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
</svg>
)
}

export function HeaderDocs() {
return (
<header className="sticky top-0 z-50 w-full border-b border-border/50 bg-background/80 backdrop-blur-lg">
<div className="mx-auto flex h-14 max-w-6xl items-center gap-4 px-6">
{/* Logo */}
<Link href="/docs" className="font-semibold tracking-tight">
helpbase
</Link>

{/* Search */}
<div className="flex flex-1 justify-center px-4">
<SearchTrigger />
</div>

{/* Right side */}
<div className="flex items-center gap-1">
<ThemeToggle />
<a
href="https://github.com/Codehagen/helpbase"
target="_blank"
rel="noopener noreferrer"
className="inline-flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
aria-label="GitHub"
>
<GitHubIcon className="size-4" />
</a>
</div>
</div>
</header>
)
}
Loading
Loading