Skip to content
Open
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
69 changes: 27 additions & 42 deletions docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,49 @@
seoPriority: 1.0
---

Sourcegraph is a Code Intelligence platform that deeply understands your code, no matter how large or where it's hosted, to power modern developer experiences.
# Documentation

- **Code Search:** Search through all of your repositories across all branches and all code hosts
- **Deep Search:** Ask natural language questions and get detailed answers from our AI agent
- **Code Intelligence:** Navigate code, find references, see code owners, trace history, and more
- **Fix and Refactor:** Roll out and track large-scale changes and migrations across repos at once
- **AI Assistant:** Use Cody, our AI code assistant to read, write, and understand your entire codebase faster
Guides for searching, understanding, and changing your codebase.

## Quickstart
New to Sourcegraph? [Get started →](/getting-started) or [take a tour](/getting-started/tour).

<QuickLinks>
<QuickLink
href="/code-search"
icon="codesearch"
imgAlt="Code Search"
title="Code Search"
description="Search all of your repositories across all branches and all code hosts."
href="/agentic-batch-changes"
title="Agentic Batch Changes"
description="Use AI agents to make, review, and ship changes across repositories."
/>
<QuickLink
href="/cody"
icon="cody"
imgAlt="Cody"
title="Cody"
description="Write, fix, and maintain code with Sourcegraph's AI coding assistant, Cody."
href="/deep-search"
title="Deep Search"
description="Ask questions and get answers from an AI agent that explores your codebase."
/>
<QuickLink
title="Deep Search"
icon="plugins"
href="/deep-search"
description="Get comprehensive answers to complex code questions using an AI agent that explores your codebase."
href="/api/mcp"
title="Sourcegraph MCP"
description="Give your AI tools and agents access to code search and codebase context."
/>
<QuickLink
title="Sourcegraph 101"
icon="plugins"
href="/getting-started"
description="Learn how to use Sourcegraph."
href="/code-search"
title="Code Search"
description="Find code across all your repositories, branches, and code hosts."
/>
<QuickLink
href="/code-navigation"
title="Code Navigation"
description="Jump to definitions and find references across your codebase."
/>
<QuickLink
title="Sourcegraph Tour"
icon="codegraph"
href="/getting-started/tour"
description="Take a tour of Sourcegraph's features using real-world examples and use cases."
href="/admin"
title="Administer Sourcegraph"
description="Deploy, configure, and manage your Sourcegraph instance."
/>
</QuickLinks>

## Main Features

Some of the main Sourcegraph features include:
## More to explore

| **Feature** | **Description** |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Deep Search** | Natural language code search with a dedicated AI agent that explores your codebase |
| **Cody** | Cody is and AI coding assistant that writes, fixes, and maintains your code |
| **Code Navigation** | Jump-to-definition, find references, and other IDE-like code browsing features on any branch, commit, or PR/code review |
| **Code Insights** | Reveal high-level information about your codebase at its current state and over time, to track migrations, version usage, vulnerability remediation, ownership, and more |
| **Batch Changes** | Make large-scale code changes across many repositories and codehosts |
| **Integrations** | With code hosts, code review tools, editors, web browsers, etc. |
[Batch Changes](/batch-changes) · [Code Insights](/code-insights) · [Integrations](/integration) · [Cody](/cody)

## What's New
---

Stay in sync and get the latest news on Sourcegraph products, technologies, and culture. [Read the blog →](https://sourcegraph.com/blog)
See what's new in Sourcegraph in the [changelog →](https://sourcegraph.com/changelog).
59 changes: 56 additions & 3 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import MdxComponents from '@/components/MdxComponents';
import {Prose} from '@/components/Prose';
import {allPosts} from 'contentlayer/generated';
import {getMDXComponent} from 'next-contentlayer2/hooks';
import {ArrowRight} from 'lucide-react';
import Link from 'next/link';
import {notFound} from 'next/navigation';

export const generateMetadata = () => {
Expand All @@ -17,17 +19,68 @@ export const generateMetadata = () => {
};
};

// Keep the landing-page cards compact without changing cards in the guides.
function HomeQuickLink({
title,
description,
href
}: {
title: string;
description: string;
href: string;
}) {
return (
<Link
href={href}
className="rounded-xl border border-light-border-2 p-5 transition-colors hover:border-vermilion-07 hover:bg-light-bg-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-vermilion-07 dark:border-dark-border dark:hover:border-vermilion-08 dark:hover:bg-dark-bg-1"
>
<div className="flex items-start justify-between gap-4">
<h2 className="font-display text-lg leading-6 text-slate-900 dark:text-white">
{title}
</h2>
<ArrowRight
aria-hidden="true"
className="mt-1 h-4 w-4 shrink-0 text-vermilion-07 dark:text-vermilion-08"
/>
</div>
<p className="mt-2 text-sm text-slate-700 dark:text-dark-text-secondary">
{description}
</p>
</Link>
);
}

const PostLayout = () => {
const post = allPosts.find(post => post._raw.flattenedPath === '');
if (!post) return notFound();
const Content = getMDXComponent(post.body.code);

return (
<>
<main className="min-w-0 max-w-2xl flex-auto px-4 py-16 lg:max-w-none lg:pl-8 lg:pr-0 xl:px-16">
<main className="min-w-0 max-w-2xl flex-auto px-4 py-10 lg:max-w-none lg:py-16 lg:pl-8 lg:pr-0 xl:px-16">
<article>
<Prose suppressHydrationWarning>
<Content components={MdxComponents()} />
<Prose
className="prose-h1:mb-3 prose-h1:text-3xl prose-h1:tracking-tight prose-h2:text-xl"
suppressHydrationWarning
>
<Content
components={{
...MdxComponents(),
QuickLinks: ({
children
}: {
children: React.ReactNode;
}) => (
<div
id="quickstart"
className="not-prose my-8 grid scroll-mt-28 grid-cols-1 gap-4 sm:grid-cols-2"
>
{children}
</div>
),
QuickLink: HomeQuickLink
}}
/>
</Prose>
</article>
</main>
Expand Down
5 changes: 0 additions & 5 deletions src/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client';

import {Hero} from '@/components/Hero';
import {Logo} from '@/components/Logo';
import {MobileNavigation} from '@/components/MobileNavigation';
import {Navigation} from '@/components/Navigation';
Expand Down Expand Up @@ -102,14 +101,10 @@ function Header() {
}

export function Layout({children}: {children: React.ReactNode}) {
let pathname = usePathname();
let isHomePage = pathname === '/';
return (
<div className="flex w-full flex-col">
<Header />

{isHomePage && <Hero />}

<div className="relative mx-auto flex w-full max-w-8xl flex-auto justify-center sm:px-2 lg:px-8 xl:px-12">
<div className="hidden lg:relative lg:block lg:flex-none">
<div className="absolute bottom-0 right-0 top-16 hidden h-12 w-px bg-transparent dark:block" />
Expand Down
Loading