flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/apps/docs/src/tabs.ts

23 lines601 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Docs in the shape of docs.continue.dev1/**
Merge branch 'worktree-agent-ab2e39e11a6493412'2 * The tabs under the header. Each shows its own part of the sidebar: the
3 * groups whose pages fit its `match`. A page belongs to the tab whose
4 * `match` it fits.
Docs in the shape of docs.continue.dev5 */
Merge branch 'worktree-agent-ab2e39e11a6493412'6export type Tab = { label: string; href: string; match: (slug: string) => boolean };
Docs in the shape of docs.continue.dev7
8export const TABS: Tab[] = [
9 {
10 label: 'Documentation',
11 href: '/',
12 match: (slug) => !slug.startsWith('reference/'),
13 },
14 {
15 label: 'API reference',
16 href: '/reference/api/',
17 match: (slug) => slug.startsWith('reference/'),
18 },
19];
20
21export function tabFor(slug: string): Tab {
22 return TABS.find((tab) => tab.match(slug)) ?? TABS[0];
23}

This file's history is long; its oldest lines are credited to the oldest commit read.