-
Notifications
You must be signed in to change notification settings - Fork 467
π feat: archived docs versions + automated librechat.yaml config version sync #770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c58f3d6
51b2a0a
9cdc943
95e3cdb
f972772
b05828f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,33 @@ | ||
| import { generateDocsMetadata, generateLocalizedDocsParams, renderDocsPage } from '@/lib/docs-page' | ||
| import { | ||
| generateArchivedDocsMetadata, | ||
| generateArchivedDocsParams, | ||
| generateDocsMetadata, | ||
| generateLocalizedDocsParams, | ||
| renderArchivedDocsPage, | ||
| renderDocsPage, | ||
| } from '@/lib/docs-page' | ||
| import { isArchivedVersion } from '@/lib/docs-archive' | ||
|
|
||
| interface PageProps { | ||
| params: Promise<{ lang: string; slug?: string[] }> | ||
| } | ||
|
|
||
| export default async function Page({ params }: PageProps) { | ||
| return renderDocsPage(await params) | ||
| const { lang, slug } = await params | ||
|
|
||
| if (isArchivedVersion(lang)) return renderArchivedDocsPage({ version: lang, slug }) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Once an archive is published, requests handled by this branch use Useful? React with πΒ / π. |
||
|
|
||
| return renderDocsPage({ lang, slug }) | ||
| } | ||
|
|
||
| export function generateStaticParams() { | ||
| return generateLocalizedDocsParams() | ||
| return [...generateLocalizedDocsParams(), ...generateArchivedDocsParams()] | ||
| } | ||
|
|
||
| export async function generateMetadata({ params }: PageProps) { | ||
| return generateDocsMetadata(await params) | ||
| const { lang, slug } = await params | ||
|
|
||
| if (isArchivedVersion(lang)) return generateArchivedDocsMetadata({ version: lang, slug }) | ||
|
|
||
| return generateDocsMetadata({ lang, slug }) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import { Callout } from 'fumadocs-ui/components/callout' | ||
|
|
||
| /** | ||
| * Shown at the top of every archived docs page. `currentHref` is the same slug | ||
| * on the live docs when it still exists, otherwise the live docs root. The | ||
| * newest release is still what most deployments run, so it is introduced as | ||
| * the latest release rather than as frozen, unmaintained docs. | ||
| */ | ||
| export function ArchivedVersionBanner({ | ||
| version, | ||
| currentHref, | ||
| latestRelease = false, | ||
| }: { | ||
| version: string | ||
| currentHref: string | ||
| latestRelease?: boolean | ||
| }) { | ||
| if (latestRelease) { | ||
| return ( | ||
| <Callout type="info" title="Latest release"> | ||
| <p className="m-0"> | ||
| You are reading the documentation for <strong>{version}</strong>, the latest release. The | ||
| main docs follow the development branch and can describe features that are not released | ||
| yet.{' '} | ||
| <a href={currentHref} className="font-medium underline"> | ||
| Go to the latest docs | ||
| </a> | ||
| . | ||
| </p> | ||
| </Callout> | ||
| ) | ||
| } | ||
|
|
||
| return ( | ||
| <Callout type="warn" title="Archived documentation"> | ||
| <p className="m-0"> | ||
| You are reading the frozen documentation for <strong>{version}</strong>, which is no longer | ||
| maintained.{' '} | ||
| <a href={currentHref} className="font-medium underline"> | ||
| Go to the latest docs | ||
| </a> | ||
| . | ||
| </p> | ||
| </Callout> | ||
| ) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the inspected
.github/workflows/links.yml, the new route regex excludes archived URL targets but the collection step at lines 63-64 still scans every English file undercontent, includingcontent/docs-archive. With the committed snapshots this expands the check from 189 live English docs to 2,389 archived MDX files, repeatedly checking duplicated external links and opening issues for link rot in snapshots that are explicitly frozen and should not be edited. Excludecontent/docs-archivefrom the input file list while retaining the archived-route exclusion for links encountered elsewhere.Useful? React with πΒ / π.