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
22 changes: 9 additions & 13 deletions apps/web/app/docs/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,13 @@ export default async function DocumentPage({ params }: PageProps) {
return (
<div className="xl:grid xl:grid-cols-[minmax(0,1fr)_13rem] xl:gap-12">
<article className="min-w-0">
<header className="border-b border-border pb-8">
<header className="border-b border-border pb-5">
{section ? (
<Link href={`/docs#${entry.section}`} className="eyebrow hover:text-fg">
{section.title}
</Link>
) : null}
<h1 className="display mt-2 text-huge leading-[1.06]">{rendered.title ?? entry.title}</h1>
<p className="mt-4 max-w-[42rem] text-mid leading-relaxed text-fg-muted text-pretty">
{entry.blurb}
</p>

<div className="mt-5 flex flex-wrap items-center gap-x-5 gap-y-2 font-mono text-micro text-fg-subtle">
<a className="textlink" href={entry.generated ? '/docs/documentation' : sourceUrl}>
{entry.generated ? 'How to update this reference' : 'Edit this page'}
</a>
{entry.generated ? <span className="chip">generated from the code</span> : null}
</div>
<h1 className="doc-title mt-2">{rendered.title ?? entry.title}</h1>
</header>

{rendered.headings.length > 0 ? (
Expand All @@ -88,10 +78,16 @@ export default async function DocumentPage({ params }: PageProps) {
</details>
) : null}

<div className="doc-body mt-10" dangerouslySetInnerHTML={{ __html: rendered.html }} />
<div className="doc-body mt-6" dangerouslySetInnerHTML={{ __html: rendered.html }} />
<CodeCopyButtons />
<MermaidDiagrams />

<p className="mt-8 text-sm text-fg-muted">
<a className="textlink" href={entry.generated ? '/docs/documentation' : sourceUrl}>
{entry.generated ? 'Update this reference' : 'Edit this page'}
</a>
</p>

<nav aria-label="Nearby documents" className="doc-nav">
{previous ? (
<Link href={docHref(previous.slug)} className="doc-nav-link doc-nav-prev">
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/docs/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export default function DocsLayout({ children }: { children: React.ReactNode })
}))

return (
<div className="shell-wide py-10 lg:grid lg:grid-cols-[14rem_minmax(0,1fr)] lg:gap-12">
<div className="docs-layout shell-wide py-10 lg:grid lg:grid-cols-[14rem_minmax(0,1fr)] lg:gap-12">
<details className="card mb-8 lg:hidden">
<summary className="cursor-pointer px-4 py-3 font-mono text-[0.75rem] tracking-[0.12em] text-fg-subtle uppercase">
<summary className="cursor-pointer px-4 py-3 font-mono text-[0.75rem] tracking-[0.12em] text-fg-muted uppercase">
Browse documentation
</summary>
<div className="border-t border-border px-4 py-4">
Expand Down
52 changes: 18 additions & 34 deletions apps/web/app/docs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ import { ogImage } from '../../src/og/card'

export const metadata: Metadata = {
title: 'Documentation',
description:
'Find step-by-step guides for members, community administrators, operators and developers.',
description: 'Meith setup, administration, operation and development guides.',
alternates: { canonical: '/docs' },
openGraph: {
type: 'website',
siteName: site.name,
title: `${site.name} documentation`,
description:
'Find step-by-step guides for members, community administrators, operators and developers.',
description: 'Meith setup, administration, operation and development guides.',
url: '/docs',
images: ogImage('/docs/og/index', `${site.name} documentation`),
},
Expand All @@ -25,45 +23,31 @@ export default function DocsIndexPage() {
return (
<div className="docs-landing">
<header className="docs-landing-hero">
<p className="edition-label">DOCUMENTATION</p>
<h1>
Let’s get you <em>started.</em>
</h1>
<p>From your first board to your next big idea.</p>
<Link className="edition-button" href={docHref('quickstart')}>
Start the quickstart <span aria-hidden>↗</span>
<h1>Documentation</h1>
<Link className="textlink" href={docHref('quickstart')}>
Run a local preview <span aria-hidden>↗</span>
</Link>
</header>

<div className="docs-landing-grid">
{sections.map((section) => {
const docs = documentsInSection(section.id)
const primary = docs.find((doc) => doc.primary)
return (
<section key={section.id} id={section.id} className="docs-landing-card">
<h2>{section.title}</h2>
<p>{section.blurb}</p>
{primary ? (
<Link href={docHref(primary.slug)} className="textlink docs-landing-primary">
{primary.title} <span aria-hidden>→</span>
</Link>
) : null}
<details>
<summary>Browse {docs.length} guides</summary>
<ul>
{docs.map((doc, index) => (
<li key={doc.slug}>
{doc.group !== undefined && doc.group !== docs[index - 1]?.group ? (
<p className="eyebrow">{doc.group}</p>
) : null}
<Link href={docHref(doc.slug)}>
{doc.title}
<span aria-hidden>↗</span>
</Link>
</li>
))}
</ul>
</details>
<ul>
{docs.map((doc, index) => (
<li key={doc.slug}>
{doc.group !== undefined && doc.group !== docs[index - 1]?.group ? (
<p className="eyebrow">{doc.group}</p>
) : null}
<Link className="textlink" href={docHref(doc.slug)}>
{doc.title}
<span aria-hidden>↗</span>
</Link>
</li>
))}
</ul>
</section>
)
})}
Expand Down
Loading
Loading