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
10 changes: 3 additions & 7 deletions .agents/skills/publishing-docs-versions/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Use this skill for the Sourcegraph docs repo release-version workflow: cutting l
- The files that control latest/previous versions are:
- `docs.config.js`
- `src/data/versions.ts`
- `docs/legacy.mdx`
- `src/data/versions.ts` on `origin/main` is the canonical dropdown list. The
current site exposes it through `/docs/api/versions`, and legacy selectors
load that manifest at runtime.
Expand Down Expand Up @@ -78,12 +77,11 @@ For `v7_3`, for example:
- `docs.config.js`: `DOCS_LATEST_VERSION: '7.3'`
- `src/data/versions.ts`: first entry identifies `v7.3` without a `latest`
label; fallback entries should include `v7.2`, `v7.1`, `v7.0`, then 6.x.
- `docs/legacy.mdx`: `Sourcegraph 7.X` should include `7.2`, `7.1`, `7.0` (not 7.3 itself).

Commit and push:

```bash
git add docs.config.js src/data/versions.ts docs/legacy.mdx
git add docs.config.js src/data/versions.ts
git commit -m "Update docs latest version to X.Y"
git push legacy vX_Y
```
Expand All @@ -104,18 +102,16 @@ For `7.4`, for example:

- `docs.config.js`: `DOCS_LATEST_VERSION: '7.4'`
- `src/data/versions.ts`: add previous versions in descending order: `v7.3`, `v7.2`, `v7.1`, `v7.0`, then 6.x.
- `docs/legacy.mdx`: add/update `Sourcegraph 7.X` with `7.3`, `7.2`, `7.1`, `7.0`.

Commit, push the branch, and open a PR:

```bash
git add docs.config.js src/data/versions.ts docs/legacy.mdx
git add docs.config.js src/data/versions.ts
git commit -m "Update docs latest version to X.Y"
git push -u origin eg-update-docs-to-X-Y
gh pr create --base main --head eg-update-docs-to-X-Y --title "Update docs latest version to X.Y" --body "## Summary
- Set DOCS_LATEST_VERSION to X.Y
- Add previous 7.x versions to the version selector
- Update the legacy versions page

## Test plan
- Not run (config/navigation content change only)"
Expand All @@ -126,7 +122,7 @@ gh pr create --base main --head eg-update-docs-to-X-Y --title "Update docs lates
Use lightweight verification for this content/config change:

```bash
git diff -- docs.config.js src/data/versions.ts docs/legacy.mdx
git diff -- docs.config.js src/data/versions.ts
git status --short --branch
git ls-remote --heads legacy 'v7_*'
```
Expand Down
1 change: 0 additions & 1 deletion dev/algolia-index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ const FALLBACK_PRODUCTS = [
{prefix: '/how-to', product: 'How-to guides', section: 'Documentation'},
{prefix: '/dotcom', product: 'Sourcegraph.com', section: 'Documentation'},
{prefix: '/releases', product: 'Releases', section: 'Documentation'},
{prefix: '/legacy', product: 'Legacy', section: 'Documentation'},
{prefix: '/pricing', product: 'Pricing', section: 'Resources'}
];

Expand Down
90 changes: 0 additions & 90 deletions docs/legacy.mdx

This file was deleted.

26 changes: 4 additions & 22 deletions src/components/VersionSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@

import {latestVersion, VersionI, versions} from '@/data/versions';
import {Menu, Transition} from '@headlessui/react';
import {
ArrowUpRightIcon,
CheckIcon,
ChevronDownIcon
} from '@heroicons/react/20/solid';
import {CheckIcon, ChevronDownIcon} from '@heroicons/react/20/solid';
import clsx from 'clsx';
import Link from 'next/link';
import {usePathname} from 'next/navigation';
import {Fragment, useEffect, useState} from 'react';

Expand Down Expand Up @@ -118,6 +113,9 @@ export default function VersionSelector() {
active &&
'bg-vermilion-08 text-vermilion-11',
count === 0 && 'rounded-t-md',
count ===
availableVersions.length - 1 &&
'rounded-b-md',
'flex w-full items-center justify-between px-3 py-2'
)}
>
Expand All @@ -140,22 +138,6 @@ export default function VersionSelector() {
)}
</Menu.Item>
))}
{/* Legacy versions */}
<Menu.Item>
{({active}) => (
<Link
href="/legacy"
className={clsx(
active &&
'bg-vermilion-08 text-vermilion-11',
'flex items-center justify-between rounded-b-md px-3 py-2'
)}
>
Legacy versions
<ArrowUpRightIcon className="h-3 w-3" />
</Link>
)}
</Menu.Item>
</Menu.Items>
</Transition>
</Menu>
Expand Down
6 changes: 6 additions & 0 deletions src/data/redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4285,6 +4285,12 @@ const redirectsData = [
source: '/admin/how-to/converting-version-contexts-to-search-contexts',
destination: '/code-search/working/search-contexts'
},
// The legacy versions page listed docs sites for unsupported versions; the
// version dropdown lists every supported version's docs site
{
source: '/legacy',
destination: '/releases'
},
];

const updatedRedirectsData = redirectsData.map(redirect => {
Expand Down
Loading