From c5e416d8a3858fb4a5a5f433296a16b7c74acfb3 Mon Sep 17 00:00:00 2001 From: Taras Yemets Date: Fri, 27 Nov 2026 14:34:08 +0000 Subject: [PATCH 1/3] docs: prepare README for legacy repository archival --- README.md | 289 ++++-------------------------------------------------- 1 file changed, 19 insertions(+), 270 deletions(-) diff --git a/README.md b/README.md index c53f88ed7..631486704 100644 --- a/README.md +++ b/README.md @@ -1,276 +1,25 @@ -# Sourcegraph Docs +# Sourcegraph Docs (legacy) -> [!WARNING] -> This repository holds the legacy Sourcegraph documentation, served at -> [docs-legacy.sourcegraph.com](https://docs-legacy.sourcegraph.com/docs). It -> only takes urgent fixes. The current docs at -> [sourcegraph.com/docs](https://sourcegraph.com/docs) are written in -> [`docs/`](https://github.com/sourcegraph/sourcegraph/tree/main/docs) in the -> private sourcegraph/sourcegraph repository; to contribute, see its -> [README](https://github.com/sourcegraph/sourcegraph/blob/main/docs/README.md). -> Without access, use the feedback link on any docs page. +This repository contains the legacy Sourcegraph documentation, served at +[docs-legacy.sourcegraph.com](https://docs-legacy.sourcegraph.com/docs). +Routine documentation updates belong in the maintained docs, not this repository. -> [!IMPORTANT] -> For support, please reach out to your account team or contact -> [support@sourcegraph.com](mailto:support@sourcegraph.com) +## Maintained documentation -Welcome to the Sourcegraph documentation! We're excited to have you contribute -to our docs. Our docs tech stack is powered by Next.js, TailwindCSS and deployed -on Vercel. This guide will walk you through the process of contributing to our -documentation. +Read the current docs at [sourcegraph.com/docs](https://sourcegraph.com/docs). +To propose changes, use +[`sourcegraph/sourcegraph/docs/`](https://github.com/sourcegraph/sourcegraph/tree/main/docs) +and follow its +[README](https://github.com/sourcegraph/sourcegraph/blob/main/docs/README.md). +The monorepo is private; without access, use the feedback link on a maintained +docs page. -## Get started +## Legacy reference and urgent fixes -Clone this repository to your local machine using the following command: +The source, history, pull requests and diffs are retained for reference. +Archiving this repository does not shut down the legacy site. +After archival, an administrator can temporarily unarchive it for an approved +urgent legacy-site fix. -```sh -git clone https://github.com/sourcegraph/docs.git docs -``` - -Navigate to the project directory by typing the following command in your -terminal: - -```sh -cd docs -``` - -Before the dependencies are installed make sure your local machine has the -following versions of `node` and `pnpm` installed: - -- node: `v24.21.0` -- pnpm: `10.25.0` - -**Note**: If you have `mise` available you can install the above versions for -only this repository by running the following command from your terminal in the -root folder: - -```sh -mise install -``` - -Now that the base requirements of the project have been satisfied, we can -install the required dependencies to run the development server! - -```sh -pnpm install -``` - -Spell checking is not part of the project dependencies. To run it locally: -`npx cspell@10 --no-progress --dot '**/*'` - -Next, run the development server: - -```sh -pnpm run dev -``` - -Finally, open [`http://localhost:3000`](http://localhost:3000) in your browser -to view the website. - -## Writing and contributing to Sourcegraph Docs - -### (Easy) Using GitHub to edit existing files - -You can easily update existing docs pages using -[GitHub's file editor](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files). -All you need to do is: - -1. Find the corresponding `.mdx` file in the [folder structure](#folder-structure). -2. Click the pencil icon to open the file editor. -3. Make your changes. -4. Click on the green "Commit changes..." button. -5. Provide a Commit message and an Extended description. -6. Click on the green "Propose changes" button to create a PR. -7. Add a PR reviewer to the Reviewers panel by clicking on the gear icon. -8. Post a link to your PR in the `#docs` Slack channel to get a quick review. - > NOTE: "Edit from GitHub" is generally recommended for text-based edits. - > For more structural-based contributions like adding React components and - > code blocks, it's always better to go with a local setup. This way, you - > can preview changes before you commit. - -### (Advanced) Local dev environment - -To add new or update existing docs content, create a new branch and check it -out. Prefix the branch with a name that identifies you (first name, username, -or nickname), so it's clear who owns each branch: - -```sh -git switch -c YOUR_NAME/BRANCH_NAME_HERE -``` - -### Folder structure - -The folder structure is exactly the same here. All the docs reside within the -`/docs` folder. Here you'll find separate folders for every docs section like -`cody`, `code-search`, `cli`, etc. - -- Navigate to the relevant section for your contribution -- If you're adding a new page, create a new MDX file (e.g., `my-new-page.mdx`) - in the appropriate folder - -### Frontmatter - -Each MDX file can include frontmatter at the top of the file to configure page -metadata. Here are the supported fields: - -| Field | Type | Required | Description | -| ------------- | ------ | -------- | ------------------------------------- | -| `title` | string | No | The page title | -| `date` | date | No | Last modified date (used in sitemap) | -| `seoPriority` | number | No | Sitemap priority 0.0–1.0, default 0.5 | -| `preview` | bool | No | Hidden; 404 without `?preview` query | - -Example: - -```yaml ---- -title: Getting Started with Cody -date: 2024-01-15 -seoPriority: 0.8 ---- -``` - -### Using MDX - -We use MDX for our documentation, which allows you to seamlessly integrate JSX -(React components) within Markdown. Write your content using standard markdown -syntax. For example, - -```md -# This is heading 1 - -This is an introductory paragraph. - -## This is heading 2 - -### This is heading 3 - -These are the details for heading three. - -This is how you add a [demo-link](https://sourcegraph.com/) - -- This is a bullet 1 -- This is bullet 2 -- This is bullet 3 -``` - -### Including React Components - -The only difference with this new stack is its ability to use React components. -We have a set of reusable React components located in the `src/components` -directory. These components are designed to enhance the user experience and -maintain consistency across our documentation. - -For example, `` adds a `note`, `info`, `tip`, or `warning` notice: - -```js -This feature is currently in Beta for all users. -``` - -![Callout components rendered in the docs](https://storage.googleapis.com/sourcegraph-assets/Docs/CleanShot%202023-12-12%20at%2012.00.29%402x.png) - -The components available in MDX are registered in -`src/components/MdxComponents.tsx`: - -| Component | Use | -| -------------------------- | ----------------------------------------------- | -| `` | `type`: `note`, `info`, `tip`, or `warning` | -| `` | Which plan or tier a feature needs | -| `` | Card grid; `` takes `title`, | -| | `description`, `href`, `icon` | -| `` | Card grid with images; `` adds | -| | `imgSrc` and `imgAlt` | -| `` | `` grid, same props as `LinkCard` | -| `` | Tabbed content; `` | -| `` | Collapsible section | -| `` | Inline label | -| `` | Release tables on `/releases`, also | -| | `` | -| `` | Page-specific widgets, also `` | -| | and `` | - -For example: - -```js - - - -``` - -### Adding a link - -To add a `link` to any docs page, use the following routing syntax: -`[Link text](path-to-link)`. - -- Do not include `/docs` in the link paths. The base URL will be - `sourcegraph.com/docs` -- There should be **no file extension** in the path name - -For example, if you want to link to the Cody Quickstart somewhere in the Code -Search docs, you should use: - -```markdown -- Link to the [Cody Quickstart](/cody/quickstart) -- Hash-link to a heading: - [Verify the install](/cody/clients/install-vscode#verifying-the-installation) -``` - -### Adding media assets (images, videos and gifs) - -You can upload images, videos and gifs to Sourcegraph docs. For a more detailed -instructions visit -[this page](https://www.notion.so/sourcegraph/How-to-host-blog-assets-using-GCP-file-storage-a2cae02bd0c74166a12eaff5062c41ad). - -> Note: Make sure to use [ImageOptim.app](https://imageoptim.com/mac) to reduce -> the size of the images before uploading, since large images degrade page -> loading speed. - -## Previewing Changes - -### Locally - -As you make changes to the documentation, the development server will -automatically update. Review your changes by navigating to -`http://localhost:3000` in your browser. - -### Previewing Vercel Deployments - -When you open a PR Vercel deploys and provides you with a preview deployment -link. To view your deployment, click the **Visit Preview** link from Vercel's -deployment panel in your PRs and you get a preview of your docs - -![Vercel deployment panel on a PR](https://github.com/user-attachments/assets/b0911e2e-95a7-4f56-b2ff-b659d13077d8) - -## Submitting your Contribution - -Once you're satisfied with your changes, follow these steps: - -- Commit your changes -- Create a pull request to the - [Sourcegraph documentation repository](https://github.com/sourcegraph/docs), - and tag the appropriate reviewers. - -### Pull request checks - -GitHub Actions comment on your PR with anything it introduces: - -- **Broken links**: internal links and `#anchors` that no longer resolve, - absolute links to this site, and external links that 404. This check fails - the PR. Locally: `pnpm run check links --check-anchors --check-self-links`. -- **Broken redirects**: entries in `src/data/redirects.ts` whose destination - no longer exists. Locally: `node dev/check-redirects.mjs`. -- **Spelling**: CSpell on the lines you added, plus the PR title and - description. Advisory only. Add product names and identifiers to - `cspell-allow-list.txt`, in alphabetical order. -- **Before and after links**: a table of the pages you changed, each on - production (before) and on the Vercel preview (after), opened at the first - section you changed. - -Thank you for contributing to Sourcegraph documentation! Your efforts help us -provide top-notch learning experiences for our users. If you have any questions -or need assistance, feel free to reach out. +For support, contact your account team or +[support@sourcegraph.com](mailto:support@sourcegraph.com). From c969cdb21f00da36c43e4e7ba68f03069a5ffaf4 Mon Sep 17 00:00:00 2001 From: Taras Yemets Date: Fri, 27 Nov 2026 14:36:42 +0000 Subject: [PATCH 2/3] fix: prevent indexing the raw legacy docs hostname --- vercel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vercel.json b/vercel.json index f1459fa46..20ed9f3d5 100644 --- a/vercel.json +++ b/vercel.json @@ -16,7 +16,7 @@ "has": [ { "type": "host", - "value": "^(\\d+\\.\\d+\\.sourcegraph\\.com|ms-docs\\.sg\\.dev|docs-legacy\\.sourcegraph\\.com)$" + "value": "^(\\d+\\.\\d+\\.sourcegraph\\.com|ms-docs\\.sg\\.dev|docs-legacy\\.sourcegraph\\.com|sourcegraph-docs-v2\\.vercel\\.app)$" } ], "headers": [{"key": "X-Robots-Tag", "value": "noindex, nofollow"}] From b81c2e4a097bbc74d6532d527cddc1c77ff2bbb6 Mon Sep 17 00:00:00 2001 From: Taras Yemets Date: Fri, 27 Nov 2026 14:40:55 +0000 Subject: [PATCH 3/3] docs: retain legacy site development instructions --- README.md | 256 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 256 insertions(+) diff --git a/README.md b/README.md index 631486704..0241aa5ee 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,259 @@ urgent legacy-site fix. For support, contact your account team or [support@sourcegraph.com](mailto:support@sourcegraph.com). + +## Get started + +Clone this repository to your local machine using the following command: + +```sh +git clone https://github.com/sourcegraph/docs.git docs +``` + +Navigate to the project directory by typing the following command in your +terminal: + +```sh +cd docs +``` + +Before the dependencies are installed make sure your local machine has the +following versions of `node` and `pnpm` installed: + +- node: `v24.21.0` +- pnpm: `10.25.0` + +**Note**: If you have `mise` available you can install the above versions for +only this repository by running the following command from your terminal in the +root folder: + +```sh +mise install +``` + +Now that the base requirements of the project have been satisfied, we can +install the required dependencies to run the development server! + +```sh +pnpm install +``` + +Spell checking is not part of the project dependencies. To run it locally: +`npx cspell@10 --no-progress --dot '**/*'` + +Next, run the development server: + +```sh +pnpm run dev +``` + +Finally, open [`http://localhost:3000`](http://localhost:3000) in your browser +to view the website. + +## Writing and contributing to Sourcegraph Docs + +### (Easy) Using GitHub to edit existing files + +You can easily update existing docs pages using +[GitHub's file editor](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files). +All you need to do is: + +1. Find the corresponding `.mdx` file in the [folder structure](#folder-structure). +2. Click the pencil icon to open the file editor. +3. Make your changes. +4. Click on the green "Commit changes..." button. +5. Provide a Commit message and an Extended description. +6. Click on the green "Propose changes" button to create a PR. +7. Add a PR reviewer to the Reviewers panel by clicking on the gear icon. +8. Post a link to your PR in the `#docs` Slack channel to get a quick review. + > NOTE: "Edit from GitHub" is generally recommended for text-based edits. + > For more structural-based contributions like adding React components and + > code blocks, it's always better to go with a local setup. This way, you + > can preview changes before you commit. + +### (Advanced) Local dev environment + +To add new or update existing docs content, create a new branch and check it +out. Prefix the branch with a name that identifies you (first name, username, +or nickname), so it's clear who owns each branch: + +```sh +git switch -c YOUR_NAME/BRANCH_NAME_HERE +``` + +### Folder structure + +The folder structure is exactly the same here. All the docs reside within the +`/docs` folder. Here you'll find separate folders for every docs section like +`cody`, `code-search`, `cli`, etc. + +- Navigate to the relevant section for your contribution +- If you're adding a new page, create a new MDX file (e.g., `my-new-page.mdx`) + in the appropriate folder + +### Frontmatter + +Each MDX file can include frontmatter at the top of the file to configure page +metadata. Here are the supported fields: + +| Field | Type | Required | Description | +| ------------- | ------ | -------- | ------------------------------------- | +| `title` | string | No | The page title | +| `date` | date | No | Last modified date (used in sitemap) | +| `seoPriority` | number | No | Sitemap priority 0.0–1.0, default 0.5 | +| `preview` | bool | No | Hidden; 404 without `?preview` query | + +Example: + +```yaml +--- +title: Getting Started with Cody +date: 2024-01-15 +seoPriority: 0.8 +--- +``` + +### Using MDX + +We use MDX for our documentation, which allows you to seamlessly integrate JSX +(React components) within Markdown. Write your content using standard markdown +syntax. For example, + +```md +# This is heading 1 + +This is an introductory paragraph. + +## This is heading 2 + +### This is heading 3 + +These are the details for heading three. + +This is how you add a [demo-link](https://sourcegraph.com/) + +- This is a bullet 1 +- This is bullet 2 +- This is bullet 3 +``` + +### Including React Components + +The only difference with this new stack is its ability to use React components. +We have a set of reusable React components located in the `src/components` +directory. These components are designed to enhance the user experience and +maintain consistency across our documentation. + +For example, `` adds a `note`, `info`, `tip`, or `warning` notice: + +```js +This feature is currently in Beta for all users. +``` + +![Callout components rendered in the docs](https://storage.googleapis.com/sourcegraph-assets/Docs/CleanShot%202023-12-12%20at%2012.00.29%402x.png) + +The components available in MDX are registered in +`src/components/MdxComponents.tsx`: + +| Component | Use | +| -------------------------- | ----------------------------------------------- | +| `` | `type`: `note`, `info`, `tip`, or `warning` | +| `` | Which plan or tier a feature needs | +| `` | Card grid; `` takes `title`, | +| | `description`, `href`, `icon` | +| `` | Card grid with images; `` adds | +| | `imgSrc` and `imgAlt` | +| `` | `` grid, same props as `LinkCard` | +| `` | Tabbed content; `` | +| `` | Collapsible section | +| `` | Inline label | +| `` | Release tables on `/releases`, also | +| | `` | +| `` | Page-specific widgets, also `` | +| | and `` | + +For example: + +```js + + + +``` + +### Adding a link + +To add a `link` to any docs page, use the following routing syntax: +`[Link text](path-to-link)`. + +- Do not include `/docs` in the link paths. The base URL will be + `sourcegraph.com/docs` +- There should be **no file extension** in the path name + +For example, if you want to link to the Cody Quickstart somewhere in the Code +Search docs, you should use: + +```markdown +- Link to the [Cody Quickstart](/cody/quickstart) +- Hash-link to a heading: + [Verify the install](/cody/clients/install-vscode#verifying-the-installation) +``` + +### Adding media assets (images, videos and gifs) + +You can upload images, videos and gifs to Sourcegraph docs. For a more detailed +instructions visit +[this page](https://www.notion.so/sourcegraph/How-to-host-blog-assets-using-GCP-file-storage-a2cae02bd0c74166a12eaff5062c41ad). + +> Note: Make sure to use [ImageOptim.app](https://imageoptim.com/mac) to reduce +> the size of the images before uploading, since large images degrade page +> loading speed. + +## Previewing Changes + +### Locally + +As you make changes to the documentation, the development server will +automatically update. Review your changes by navigating to +`http://localhost:3000` in your browser. + +### Previewing Vercel Deployments + +When you open a PR Vercel deploys and provides you with a preview deployment +link. To view your deployment, click the **Visit Preview** link from Vercel's +deployment panel in your PRs and you get a preview of your docs + +![Vercel deployment panel on a PR](https://github.com/user-attachments/assets/b0911e2e-95a7-4f56-b2ff-b659d13077d8) + +## Submitting your Contribution + +Once you're satisfied with your changes, follow these steps: + +- Commit your changes +- Create a pull request to the + [Sourcegraph documentation repository](https://github.com/sourcegraph/docs), + and tag the appropriate reviewers. + +### Pull request checks + +GitHub Actions comment on your PR with anything it introduces: + +- **Broken links**: internal links and `#anchors` that no longer resolve, + absolute links to this site, and external links that 404. This check fails + the PR. Locally: `pnpm run check links --check-anchors --check-self-links`. +- **Broken redirects**: entries in `src/data/redirects.ts` whose destination + no longer exists. Locally: `node dev/check-redirects.mjs`. +- **Spelling**: CSpell on the lines you added, plus the PR title and + description. Advisory only. Add product names and identifiers to + `cspell-allow-list.txt`, in alphabetical order. +- **Before and after links**: a table of the pages you changed, each on + production (before) and on the Vercel preview (after), opened at the first + section you changed. + +Thank you for contributing to Sourcegraph documentation! Your efforts help us +provide top-notch learning experiences for our users. If you have any questions +or need assistance, feel free to reach out.