fix(docs): correct versioned nav links and local dev version routing (#74)

This commit is contained in:
2026-05-18 01:07:17 -07:00
committed by GitHub
parent 6b2cb002ac
commit 799cce6991
19 changed files with 1000 additions and 57 deletions
+15 -4
View File
@@ -1,3 +1,5 @@
import { createHash } from 'node:crypto';
export type DocsVersionEntry = {
version: string;
path: string;
@@ -57,14 +59,23 @@ export function versionArchiveCacheName(version: string, sharedInternalsHash: st
return `${sharedInternalsHash.slice(0, 12)}-${version}`;
}
export function versionArchiveCacheKey(options: {
sharedInternalsHash: string;
manifestJson: string;
}): string {
const hash = createHash('sha256');
hash.update('shared-internals:');
hash.update(options.sharedInternalsHash);
hash.update('\nmanifest:');
hash.update(options.manifestJson);
return hash.digest('hex');
}
export function stableTagsWithDocs(
tags: string[],
hasDocsSite: (tag: string) => boolean,
): string[] {
return tags
.filter(isStableReleaseTag)
.filter(hasDocsSite)
.sort(compareStableVersionsDesc);
return tags.filter(isStableReleaseTag).filter(hasDocsSite).sort(compareStableVersionsDesc);
}
export function buildVersionManifest(options: {